From: Jonathan Cameron <jic23@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Cosmin Tanislav <cosmin.tanislav@analog.com>,
linux-iio@vger.kernel.org, patches@lists.linux.dev,
llvm@lists.linux.dev, kernel test robot <lkp@intel.com>,
Colin Ian King <colin.i.king@gmail.com>
Subject: Re: [PATCH] iio: accel: adxl367: Fix handled initialization in adxl367_irq_handler()
Date: Sat, 26 Feb 2022 18:00:32 +0000 [thread overview]
Message-ID: <20220226180032.455dc1c2@jic23-huawei> (raw)
In-Reply-To: <20220224211034.625130-1-nathan@kernel.org>
On Thu, 24 Feb 2022 14:10:34 -0700
Nathan Chancellor <nathan@kernel.org> wrote:
> 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: cbab791c5e2a ("iio: accel: add ADXL367 driver")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1605
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Applied to the togreg branch of iio.git.
I also added a second reported-by to reflect the next patch setting in my inbox which
was Colin fixing the same thing.
Thanks!
> ---
> drivers/iio/accel/adxl367.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c
> index b452d74b1d4d..350a89b61179 100644
> --- a/drivers/iio/accel/adxl367.c
> +++ b/drivers/iio/accel/adxl367.c
> @@ -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;
>
> base-commit: 2be8795a609800e5071d868d459ce29232fce2c8
next prev parent reply other threads:[~2022-02-26 17:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 21:10 [PATCH] iio: accel: adxl367: Fix handled initialization in adxl367_irq_handler() Nathan Chancellor
2022-02-26 18:00 ` Jonathan Cameron [this message]
2022-02-26 19:49 ` Andy Shevchenko
2022-02-27 12:02 ` Jonathan Cameron
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=20220226180032.455dc1c2@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=colin.i.king@gmail.com \
--cc=cosmin.tanislav@analog.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=patches@lists.linux.dev \
/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