Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6554961rwb; Tue, 22 Nov 2022 15:18:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf4lnz4yq0DfJCCbhcEWkm58cmth0BKp6e690Is90iSMAJQyl8aTqxcFeR4gIQNwfbCke7CY X-Received: by 2002:a05:6402:3807:b0:45c:a651:87f1 with SMTP id es7-20020a056402380700b0045ca65187f1mr6593176edb.359.1669159139408; Tue, 22 Nov 2022 15:18:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669159139; cv=none; d=google.com; s=arc-20160816; b=S+lDuUmd001B2Wg5XcmVinnmxoD1eBGwiLzy8t9hJyhckQX/nFiv4KjI1uaQrNLj/q DpyoQukAq65pHyLTn9Qy2MZosHtPPmEqbq5T1glFzzDEG1hejcrlXG3rHlCRN4oBN1Mm WCMwItEp2a4NZ8JKSosatSa0e3b/gKk3Xf25K5W8yO835S3Z7DjqbDsvQDjVVESsl80b zLzsItjdXLsmbQvHWHAix7I9xSnZStEaVRlKVcB8nZN/YgzHDq2LKzNbglvDOCi0ISng W9JuSj5XU0QXh8ip4Xb3XjIrZL7DpT7M97q63V4Etlv1CJwLuK1BC71LgUnLfnHxGmXn VZmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GI2Ao1YqhqfVzFF9Hmgl8saIhBJq+Op5pO2DH3V+ATc=; b=tEGFl0BrcPVAZgCVsJZrYePEDk6HZflyn/Q3I6Qoun0r1VNAVdcIc3QKnK+8qce8hA sX+ck3dcPOtRKqDBM3YWvFkiy3Gz0ghDVyn9ICB9I6PfGbHB8L4e3mGc1wKNhwJH9Dx2 XdTepWMK+GonI5UWXdqwDCaCm30rRjuBgC49DhT4Dhzmxcry7b/8huES++cC+bj0CFHN giAXKeVQOKRp3h3UBIluaT3gS0QhUW6t3f77zJeT9u8KmdKOdeoP703GCOU/s1zJwz5Z UyFxS7Q8OyWZxbV6viKtbbu580GR20gMIk18FD3D9w3wEZK0rs/C1l40Oqf+VBe0xBpY gG8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ucw.cz header.s=gen1 header.b=HDD6E1tm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ucw.cz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xj10-20020a170906db0a00b007adef1dceffsi14340590ejb.677.2022.11.22.15.18.37; Tue, 22 Nov 2022 15:18:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ucw.cz header.s=gen1 header.b=HDD6E1tm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ucw.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235158AbiKVXJG (ORCPT + 89 others); Tue, 22 Nov 2022 18:09:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234710AbiKVXJE (ORCPT ); Tue, 22 Nov 2022 18:09:04 -0500 Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7D7CB7017; Tue, 22 Nov 2022 15:08:58 -0800 (PST) Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 68DFE1C09DB; Wed, 23 Nov 2022 00:08:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1669158536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GI2Ao1YqhqfVzFF9Hmgl8saIhBJq+Op5pO2DH3V+ATc=; b=HDD6E1tmXtPABW9ZhoYTHGxiZauYH+pPH3M3EJUh2mAamz0zi6mDrgk+P55nJRO6vAHJQF MQqXP7WsQdDE1FNulV18PGRBRX2AV4Jpqjf2FQOSq++4ObGA1nHcbYiOGsjDiOOJHMRkDz /DqW5IdvQaGrjdzx8qtBRJ4os7RVJo0= Date: Wed, 23 Nov 2022 00:08:55 +0100 From: Pavel Machek To: Shuah Khan Cc: patches@opensource.cirrus.com, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] leds: leds-wm831x-status: init chip_pdata before access Message-ID: References: <20221122204837.11611-1-skhan@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x4sEWpz0m1JkPymp" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --x4sEWpz0m1JkPymp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue 2022-11-22 15:39:35, Shuah Khan wrote: > On 11/22/22 14:05, Pavel Machek wrote: > > Hi! > >=20 > > > wm831x_status_probe() accesses status from chip_pdata before > > > initializing it. Fix it. > > >=20 > > > Signed-off-by: Shuah Khan > >=20 > > Does it? ARRAY_SIZE() will be compile-time constant, no? > >=20 > > What is the bug? Did you test the code? > >=20 >=20 > Is ARRAY_SIZE() safe when accessing the status chip_pdata->status? > I wasn't sure. If so, this change isn't necessary. I think so. Feel free to quite C standard to prove me wrong :-). Best regards, Pavel --=20 People of Russia, stop Putin before his war on Ukraine escalates. --x4sEWpz0m1JkPymp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCY31WhwAKCRAw5/Bqldv6 8k76AJ9rMhV61HT+oU3PrDTjKlwjBHxh0ACghvisv1NhzFrW//h09qSKpeGsxY0= =x3py -----END PGP SIGNATURE----- --x4sEWpz0m1JkPymp--