Linux IIO development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Remi Buisson <remi.buisson@tdk.com>
Cc: linux-iio@vger.kernel.org
Subject: [bug report] iio: imu: inv_icm45600: add buffer support in iio devices
Date: Wed, 22 Oct 2025 14:05:03 +0300	[thread overview]
Message-ID: <aPi6Xw-ZoUkW76zR@stanley.mountain> (raw)

Hello Remi Buisson,

Commit 06674a72cf7a ("iio: imu: inv_icm45600: add buffer support in
iio devices") from Oct 7, 2025 (linux-next), leads to the following
Smatch static checker warning:

	drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c:377 inv_icm45600_buffer_postdisable()
	error: uninitialized symbol 'sleep'.

drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c
    354 static int inv_icm45600_buffer_postdisable(struct iio_dev *indio_dev)
    355 {
    356         struct inv_icm45600_state *st = iio_device_get_drvdata(indio_dev);
    357         struct device *dev = regmap_get_device(st->map);
    358         unsigned int sensor;
    359         unsigned int *watermark;
    360         unsigned int sleep;
    361         int ret;
    362 
    363         if (indio_dev == st->indio_gyro) {
    364                 sensor = INV_ICM45600_SENSOR_GYRO;
    365                 watermark = &st->fifo.watermark.gyro;
    366         } else if (indio_dev == st->indio_accel) {
    367                 sensor = INV_ICM45600_SENSOR_ACCEL;
    368                 watermark = &st->fifo.watermark.accel;
    369         } else {
    370                 return -EINVAL;
    371         }
    372 
    373         scoped_guard(mutex, &st->lock)
    374                 ret = _inv_icm45600_buffer_postdisable(st, sensor, watermark, &sleep);
    375 
    376         /* Sleep required time. */
--> 377         if (sleep)

sleep is only set if _inv_icm45600_buffer_postdisable() succeeds.

    378                 msleep(sleep);
    379 
    380         pm_runtime_put_autosuspend(dev);
    381 
    382         return ret;
    383 }

regards,
dan carpenter

             reply	other threads:[~2025-10-22 11:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 11:05 Dan Carpenter [this message]
2025-10-31 11:06 ` [bug report] iio: imu: inv_icm45600: add buffer support in iio devices Remi Buisson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aPi6Xw-ZoUkW76zR@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=remi.buisson@tdk.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox