Commit 185897d0 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Jonathan Cameron

iio: accel: adxl367: Fix handled initialization in adxl367_irq_handler()

Clang warns:

  drivers/iio/accel/adxl367.c:887:2: error: variable 'handled' is uninitialized when used here [-Werror,-Wuninitialized]
          handled |= adxl367_push_event(indio_dev, status);
          ^~~~~~~
  drivers/iio/accel/adxl367.c:879:14: note: initialize the variable 'handled' to silence this warning
          bool handled;
                      ^
                       = 0
  1 error generated.

This should have used '=' instead of '|='; make that change to resolve
the warning.

Fixes: cbab791c ("iio: accel: add ADXL367 driver")
Link: https://github.com/ClangBuiltLinux/linux/issues/1605Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarColin Ian King <colin.i.king@gmail.com>
Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20220224211034.625130-1-nathan@kernel.orgSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 7948d301
......@@ -884,7 +884,7 @@ static irqreturn_t adxl367_irq_handler(int irq, void *private)
if (ret)
return IRQ_NONE;
handled |= adxl367_push_event(indio_dev, status);
handled = adxl367_push_event(indio_dev, status);
handled |= adxl367_push_fifo_data(indio_dev, status, fifo_entries);
return handled ? IRQ_HANDLED : IRQ_NONE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment