From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C573B3D70; Sat, 26 Feb 2022 17:53:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2017C340E8; Sat, 26 Feb 2022 17:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645898012; bh=VIfKV/A7k3FnJWADKVUq0cdczoP09UdBX8T7X4jHHCo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VIuYPZeKVVkLRGy2MbqyzV1ZhwEYvH2qfnxaLNNZcoYP9CSXExnHSiVzfqKdwD3AD qnP5XdmKKJvh9zTppnC+ng/wzxeQzBrK+EloN+oh4pLEMl3648gKT2+mIwZYQ5/2wr efu19OwcAHnDBeoxbREGR1jhA2LFHj2Qgozfw05ZbqBk2f2y8BzPYxwoGBigVXFtyv UPqPzCH0BbOL+Uo6vxAmQA1tzQIIV/23FdZWemRoE1oRLyWkAxpd1hx2TUhfOPeSUr ha/e47aMUxQdu1NrneragnIbpkHw4N69UDjP5IbN1AtOezNBJQ6XPMZ7yYvHhPGLf2 pJhEFntjgBxdA== Date: Sat, 26 Feb 2022 18:00:32 +0000 From: Jonathan Cameron To: Nathan Chancellor Cc: Lars-Peter Clausen , Michael Hennerich , Cosmin Tanislav , linux-iio@vger.kernel.org, patches@lists.linux.dev, llvm@lists.linux.dev, kernel test robot , Colin Ian King Subject: Re: [PATCH] iio: accel: adxl367: Fix handled initialization in adxl367_irq_handler() Message-ID: <20220226180032.455dc1c2@jic23-huawei> In-Reply-To: <20220224211034.625130-1-nathan@kernel.org> References: <20220224211034.625130-1-nathan@kernel.org> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 24 Feb 2022 14:10:34 -0700 Nathan Chancellor 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 > Signed-off-by: Nathan Chancellor 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