Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp257033pxm; Wed, 2 Mar 2022 14:45:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJssH4UVijhd5dyBl1CAs06fdhzJMM+6Cemwh2qSTu26tfGidK9wagkwh+an/ysqV76G08 X-Received: by 2002:a17:903:2051:b0:14f:fb3d:bead with SMTP id q17-20020a170903205100b0014ffb3dbeadmr32350271pla.102.1646261134874; Wed, 02 Mar 2022 14:45:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646261134; cv=none; d=google.com; s=arc-20160816; b=QqNxkdrpu0F6KQK7qhoPNoRAesA93UzpYlEcwPd9HScFm4Jo7UtkICkH5NTSs+E7Q8 3rlTqFNl0aIvHfwu9rDlcCCpI/cTF42+dWRpdnH2CB2NsCuJJzC/efWizZhjOuj8prEL h98xFzw3k2lr8dpK3Hm5Hi1VQyqMSag6aiZdgJ323PyPG+5YtUtphlVjdQWS6LJOhkVR Hl66OqIN3Xdar5IgDmWg4B9+DpbrN1Kb5zCKvtExXn3pd4Sf5jdDt63f5IuHpw4R0vpk q3sihVxVDQ5u//3ceSY9tNWjsHlPYHvkawOCBAhQzfa5a8/KegcrC7kQgOFlVV1Bvp2j dXnA== 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; bh=EUV0lUnkh1ThDMWFxabWW8S/zpxwd4RbZHRLpjsURwQ=; b=GjGgzyXcCRgwMi5yK9rk2XHHkbcEo3hjQE/aVuILz+PP4ac8IldhNf06UfUeIIjKtW b8Vgqse1lY5wPQLtMqNLwdOk0lWDin92XpIrTZbn2/+hQuutkYeXteMOmu06vQeQhhif 84PO04gzlms2rHWbJwjhs4Hd/VUYvHE2sOwMnr3BRv2dDnARAL7zJmxl+rRuj/KldITX BRji3/r6T3xASZeiWfy8Re29qRcLJflrUxNdOGkE7S6occM+WL8z2R41J1AB0iynkQAX 0fI0qmfomxojkSLJHI1D1p3niMAgLTla1bTBfQ+XKmv6h8O514aEqoZ9FK7n/jcBybfr g/8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f22-20020a056a0022d600b004bf2e472b61si409511pfj.13.2022.03.02.14.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 14:45:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 215E43F317; Wed, 2 Mar 2022 14:37:54 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242093AbiCBNFZ (ORCPT + 99 others); Wed, 2 Mar 2022 08:05:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242088AbiCBNFV (ORCPT ); Wed, 2 Mar 2022 08:05:21 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D68FC4289 for ; Wed, 2 Mar 2022 05:04:31 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nPOeY-0004N5-BG; Wed, 02 Mar 2022 14:04:26 +0100 Received: from pengutronix.de (2a03-f580-87bc-d400-5c51-3418-45e9-21d0.ip6.dokom21.de [IPv6:2a03:f580:87bc:d400:5c51:3418:45e9:21d0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 5F06B40CC0; Wed, 2 Mar 2022 13:04:23 +0000 (UTC) Date: Wed, 2 Mar 2022 14:04:23 +0100 From: Marc Kleine-Budde To: Vincent MAILHOL Cc: kernel test robot , kbuild-all@lists.01.org, Linux Kernel Mailing List , Arunachalam Santhanam , linux-can Subject: Re: drivers/net/can/usb/etas_es58x/es58x_fd.c:174:8: warning: Uninitialized variable: rx_event_msg [uninitvar] Message-ID: <20220302130423.ddd2ulldffpo5lb2@pengutronix.de> References: <202203021333.mMJpWPzx-lkp@intel.com> <5f13b914-e309-49ee-4f98-c81780c478b9@intel.com> <20220302103219.kvpfhc6qz42t3pvv@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="56xh6vvo7owhvdci" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 --56xh6vvo7owhvdci Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 02.03.2022 21:49:27, Vincent MAILHOL wrote: > > I think it's possible to assign rx_event_msg before the > > es58x_check_msg_len(). >=20 > Yes, I will do so. Even if this is a false positive, this pattern > can be misleading. e.g. during a code review, this does indeed > look incorrect at first glance. >=20 > Also, doing such change would be consistent with was is done in > other functions: > https://elixir.bootlin.com/linux/latest/source/drivers/net/can/usb/etas_e= s58x/es58x_fd.c#L210 >=20 > This not being a bug fix, is it fine to send it to net-next? ACK > Or do you see a need to backport this? Don't think so. > > I think (hope?) the compiler will not optimize > > anything away. :) >=20 > With a function call and a return statement, the compiler would > need to be severely defective to try to optimize this away :) I was thinking of this: | void *foo =3D bar->baz; |=20 | if (!bar) | return; |=20 | printf("%p", foo); There were/are compilers that optimize the bar NULL pointer check away, because bar has already been de-referenced. Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --56xh6vvo7owhvdci Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmIfa1QACgkQrX5LkNig 0123Qgf/RpK66S6/00nnYIK17FjG95rGgcEjTFYWj2ir4Ovuaw3GujZW1y0abN82 TnG3X6EFnNHYVbf3U7KGYku+YJ/OvD5wsNY9/Cuvl1fK+ttCb89nO4CxeEmFarI9 xErdeT656hGzVi3saAQEHSaE/JHedk2F61P8ncwm63z5U9r9nKN63bwqi/2S2j+s cJbv3LXbmUR473wZVgyZBXEC3JDM9KJ+PHo1g6RskySTtC6l1dx5La0gs8v72kqi X74fvgcJBXkCR/xppPhl1Iu7EwHt1xdZUI9YnPdeCF0EBa2ODK4jRGBJPolpj00i IadoT7WOi5iyhJmh1oNvZ1t4aWrbqQ== =wr6A -----END PGP SIGNATURE----- --56xh6vvo7owhvdci--