All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio:cdc:ad7150: Fix use of uninitialized ret
@ 2021-04-06  8:32 Jonathan Cameron
  2021-04-06  8:44 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Cameron @ 2021-04-06  8:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Jonathan Cameron, kbuild test robot

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This doesn't appear to generate a warning on all versions of GCC, but
0-day reported it and the report looks valid.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reported-by: kbuild test robot <lkp@intel.com>
---
 drivers/iio/cdc/ad7150.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/cdc/ad7150.c b/drivers/iio/cdc/ad7150.c
index f9cce1a64586..ebe112b4618b 100644
--- a/drivers/iio/cdc/ad7150.c
+++ b/drivers/iio/cdc/ad7150.c
@@ -235,7 +235,7 @@ static int ad7150_write_event_config(struct iio_dev *indio_dev,
 				     enum iio_event_direction dir, int state)
 {
 	struct ad7150_chip_info *chip = iio_priv(indio_dev);
-	int ret;
+	int ret = 0;
 
 	/*
 	 * There is only a single shared control and no on chip
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio:cdc:ad7150: Fix use of uninitialized ret
  2021-04-06  8:32 [PATCH] iio:cdc:ad7150: Fix use of uninitialized ret Jonathan Cameron
@ 2021-04-06  8:44 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2021-04-06  8:44 UTC (permalink / raw)
  To: linux-iio; +Cc: Jonathan Cameron, kbuild test robot

On Tue,  6 Apr 2021 09:32:44 +0100
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> This doesn't appear to generate a warning on all versions of GCC, but
> 0-day reported it and the report looks valid.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Reported-by: kbuild test robot <lkp@intel.com>

For this one, it's the sort of thing I'd normally just roll into the original
patch, but there is a merge in my tree after this, so in the interests of
simplicity I've applied it on top.

Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to take another look at it and see what I got wrong this time :)

Jonathan

> ---
>  drivers/iio/cdc/ad7150.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/cdc/ad7150.c b/drivers/iio/cdc/ad7150.c
> index f9cce1a64586..ebe112b4618b 100644
> --- a/drivers/iio/cdc/ad7150.c
> +++ b/drivers/iio/cdc/ad7150.c
> @@ -235,7 +235,7 @@ static int ad7150_write_event_config(struct iio_dev *indio_dev,
>  				     enum iio_event_direction dir, int state)
>  {
>  	struct ad7150_chip_info *chip = iio_priv(indio_dev);
> -	int ret;
> +	int ret = 0;
>  
>  	/*
>  	 * There is only a single shared control and no on chip


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-06  8:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06  8:32 [PATCH] iio:cdc:ad7150: Fix use of uninitialized ret Jonathan Cameron
2021-04-06  8:44 ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.