Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6020238pxv; Thu, 29 Jul 2021 04:35:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNJNJ0D8rKKwM4JVGzY7S+1NPtj3wHWmri4J8HkckzdhnuMHBEt/CjE2p+MHG6m1SkOrKZ X-Received: by 2002:a17:906:6009:: with SMTP id o9mr4242261ejj.266.1627558546471; Thu, 29 Jul 2021 04:35:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627558546; cv=none; d=google.com; s=arc-20160816; b=0TyqqAV78ebQDdGTklOt8RwKbhfn5ukLuASvDQwe5B2yJJspbetih925s4E1iO9c/y YVBiqrw6C5cJIH6jsAWbwD0lq6TUutgIAK1mEu+yXdaA9ddKhIkz9czqTxPCqc2naz91 RThxNOoDT/T2v15Ni/bjioKKjOXDhThtIemo7QXK1sVRWdtWZ5iucnmMP6joSKnwENmh bt5W3P+VWsd4d8pRJfiU/4f6bugnBLV7tZGKkOhigEppxwaeQQ0GyIbvJJerFFpgJclW Y6N+b/1elhZngN1PQV4L9VTaH38yIu//I5RqErZIUy6wE9yzFKEhf2j9GHg0xWWndb1/ vjcQ== 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=OgldemiEI7ikgngSzu+tQRB6fUWXLl4s/EgStYgBaQo=; b=wN2ypuv4zbCFQmM5D0t2SDXR6SKcgiimDlLVuTGv+NecJkV3LawkZbbsX7nyDzMv4M akGjFDBTPOC8wSKMErcPuTZzeASkWwSstlh0heY7nWjhJgrnllc1qNPvPivxzRmUmt/x jOYZ0Zj9qItMhy0syADHKFeJnQ7QolqS7vwsvBrRwJwmJTZ/aNtHBqpt1Es5wCSofMwU 1rC4UBpV476JZLfREm7JL3x8KUc38Z4HxIMRCLLNJT9Ydym8qbavQ14EGdzW9kznOtdd sszpcdcELuzOkQzj4NhwClXpFrl3Ez0YrJxpSZLKzP2K7OdjG/oZbnwfQjXEjlzxEJmh WBHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u18si2567641ejk.196.2021.07.29.04.35.22; Thu, 29 Jul 2021 04:35:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236845AbhG2LbR (ORCPT + 99 others); Thu, 29 Jul 2021 07:31:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236840AbhG2LbQ (ORCPT ); Thu, 29 Jul 2021 07:31:16 -0400 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 A97C5C061765 for ; Thu, 29 Jul 2021 04:31:13 -0700 (PDT) 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 1m94Fj-0003Hd-QR; Thu, 29 Jul 2021 13:31:03 +0200 Received: from pengutronix.de (unknown [IPv6:2a03:f580:87bc:d400:f664:c769:c9a5:5ced]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) 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 B4D1865ADC8; Thu, 29 Jul 2021 11:31:01 +0000 (UTC) Date: Thu, 29 Jul 2021 13:31:01 +0200 From: Marc Kleine-Budde To: Christophe JAILLET Cc: wg@grandegger.com, davem@davemloft.net, kuba@kernel.org, angelo@kernel-space.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] can: flexcan: Fix an uninitialized variable issue Message-ID: <20210729113101.n5aucrwu56lyqhg7@pengutronix.de> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iwr5k3fcdfx7llyh" 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --iwr5k3fcdfx7llyh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 29.07.2021 13:27:42, Christophe JAILLET wrote: > If both 'clk_ipg' and 'clk_per' are NULL, we return an un-init value. > So set 'err' to 0, to return success in such a case. Thanks for the patch, a similar one has been posted before: https://lore.kernel.org/linux-can/20210728075428.1493568-1-mkl@pengutronix.= de/ > Fixes: d9cead75b1c6 ("can: flexcan: add mcf5441x support") > Signed-off-by: Christophe JAILLET > --- > Another way to fix it is to remove the NULL checks for 'clk_ipg' and > 'clk_per' that been added in commit d9cead75b1c6. >=20 > They look useless to me because 'clk_prepare_enable()' returns 0 if it is > passed a NULL pointer. ACK, while the common clock framework's clk_prepare_enable() can handle NULL pointers, the clock framework used on the mcf5441x doesn't. > Having these explicit tests is maybe informational (i.e. these pointers > can really be NULL) or have been added to silent a compiler or a static > checker. >=20 > So, in case, I've left the tests and just fixed the un-init 'err' variable > issue. regards, 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 | --iwr5k3fcdfx7llyh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmECkXIACgkQqclaivrt 76liEgf8CJEbFuAHrQs7n44BCSVb8JpZhXWz5uhZssbo6/VqBt1hytspXKvROp4z FysbdjX6nHDX0vfJpg3uG/d35Zbl8I2iMw4fPE1AdkOlDf96uWwl4M5dkSxuoXx5 BUdXCncRW6BTQV2lXmXyVoxT64U8xE1HmhKcYr4uzJ1SvQxH9bLr5as1YW1tO9d4 /3snPM3X9YFV7kf0UCuqsOJDFmqJr5xWOqX5/WaG8zX59ltbT7VsXImq+vk1Bre8 EMqX+JlmLrjHBGd9rG4vzMAA0AJGSaEpQKLF7bbsIOKelKTR4U/aSkD8FYz/+i+B 6h5IxbMFQDaVabIECJpOhHVyQ36L9g== =SScx -----END PGP SIGNATURE----- --iwr5k3fcdfx7llyh--