[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aQTKUE4Nj77LKfbD@smile.fi.intel.com>
Date: Fri, 31 Oct 2025 16:40:16 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: remi.buisson@....com
Cc: Jonathan Cameron <jic23@...nel.org>,
David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] iio: imu: inv_icm45600: Initializes
inv_icm45600_buffer_postdisable sleep
On Fri, Oct 31, 2025 at 01:57:06PM +0000, Remi Buisson via B4 Relay wrote:
>
> The sleep variable in inv_icm45600_buffer_postdisable could be used without
> being assigned in case of error. It must be initialized to 0 by default.
> Fixes: 06674a72cf7a ("iio: imu: inv_icm45600: add buffer support in iio devices")
This is part of the tag block, needs to go together (on one paragraph, means no
blank lines in between) with your SoB and other tags, if applicable.
> Smatch static checker warning:
>
> drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c:377 inv_icm45600_buffer_postdisable()
> error: uninitialized symbol 'sleep'.
Is there a public message / report on this? If so, use Closes: tag to point to
it.
> Signed-off-by: Remi Buisson <remi.buisson@....com>
...
> struct device *dev = regmap_get_device(st->map);
> unsigned int sensor;
> unsigned int *watermark;
> - unsigned int sleep;
> + unsigned int sleep = 0;
As I said, the preferred way is to decouple definition and assignment. The best
place for it is just before scope_guard() call.
sleep = 0;
scoped_guard(mutex, &st->lock)
ret = _inv_icm45600_buffer_postdisable(st, sensor, watermark, &sleep);
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists