[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1jldub1n8n.fsf@starbuckisacylon.baylibre.com>
Date: Wed, 12 Feb 2025 11:16:56 +0100
From: Jerome Brunet <jbrunet@...libre.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: oe-kbuild@...ts.linux.dev, Greg Kroah-Hartman
<gregkh@...uxfoundation.org>, Dave Ertman <david.m.ertman@...el.com>,
Ira Weiny <ira.weiny@...el.com>, "Rafael J. Wysocki"
<rafael@...nel.org>, Stephen Boyd <sboyd@...nel.org>, Arnd Bergmann
<arnd@...db.de>, lkp@...el.com, oe-kbuild-all@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 6/7] clk: clk-imx8mp-audiomix: use the auxiliary
device creation helper
On Wed 12 Feb 2025 at 10:26, Dan Carpenter <dan.carpenter@...aro.org> wrote:
> Hi Jerome,
>
> kernel test robot noticed the following build warnings:
>
> url:
> https://github.com/intel-lab-lkp/linux/commits/Jerome-Brunet/driver-core-auxiliary-bus-add-device-creation-helper/20250207-023433
> base: 2014c95afecee3e76ca4a56956a936e23283f05b
> patch link: https://lore.kernel.org/r/20250206-aux-device-create-helper-v2-6-fa6a0f326527%40baylibre.com
> patch subject: [PATCH v2 6/7] clk: clk-imx8mp-audiomix: use the auxiliary device creation helper
> config: xtensa-randconfig-r071-20250208
> (https://download.01.org/0day-ci/archive/20250208/202502081655.FlCrxpYN-lkp@intel.com/config)
> compiler: xtensa-linux-gcc (GCC) 14.2.0
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@...el.com>
> | Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
> | Closes: https://lore.kernel.org/r/202502081655.FlCrxpYN-lkp@intel.com/
>
> smatch warnings:
> drivers/clk/imx/clk-imx8mp-audiomix.c:241
> clk_imx8mp_audiomix_reset_controller_register() warn: passing zero to
> 'PTR_ERR'
>
> vim +/PTR_ERR +241 drivers/clk/imx/clk-imx8mp-audiomix.c
>
> c350f4c434316c Jerome Brunet 2025-02-06 231 static int
> clk_imx8mp_audiomix_reset_controller_register(struct device *dev)
> 6f0e817175c5b2 Shengjiu Wang 2024-06-14 232 {
> c350f4c434316c Jerome Brunet 2025-02-06 233 struct auxiliary_device *adev;
> 6f0e817175c5b2 Shengjiu Wang 2024-06-14 234
> 6f0e817175c5b2 Shengjiu Wang 2024-06-14 235 if (!of_property_present(dev->of_node, "#reset-cells"))
> 6f0e817175c5b2 Shengjiu Wang 2024-06-14 236 return 0;
> 6f0e817175c5b2 Shengjiu Wang 2024-06-14 237
> c350f4c434316c Jerome Brunet 2025-02-06 238 adev = devm_auxiliary_device_create(dev, KBUILD_MODNAME,
> c350f4c434316c Jerome Brunet 2025-02-06 239 "reset", NULL, 0);
> c350f4c434316c Jerome Brunet 2025-02-06 240 if (IS_ERR_OR_NULL(adev))
> c350f4c434316c Jerome Brunet 2025-02-06 @241 return PTR_ERR(adev);
>
> If devm_auxiliary_device_create() could return NULL then that would count
> as success. But devm_auxiliary_device_create() can't return NULL. It
> only makes sense to return NULL if the auxiliary device is optional.
Hi Dan,
It should have been IS_ERR() there. It is something I've noticed and
fixed in the other changes before submitting the v2 but, somehow, this
one slipped through. Thanks for catching this. This is obviously still
present in the v3 I've sent yesterday but will be fixed on the next
version. I'm waiting for feedback on the core part before making another
one.
Cheers
>
> https://staticthinking.wordpress.com/2022/08/01/mixing-error-pointers-and-null/
>
> 6f0e817175c5b2 Shengjiu Wang 2024-06-14 242
> 6f0e817175c5b2 Shengjiu Wang 2024-06-14 243 return 0;
> 6f0e817175c5b2 Shengjiu Wang 2024-06-14 244 }
--
Jerome
Powered by blists - more mailing lists