public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] adis16080: fix compiler -Wuninitialized
@ 2012-02-14 14:35 Danny Kukawka
  2012-02-14 15:04 ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Danny Kukawka @ 2012-02-14 14:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Danny Kukawka, Michael Hennerich, Lars-Peter Clausen,
	Paul Gortmaker, linux-iio, devel, linux-kernel

Fix for:
drivers/staging/iio/gyro/adis16080_core.c: In function
  ‘adis16080_read_raw’:
drivers/staging/iio/gyro/adis16080_core.c:99:8: warning: ‘ut’
  may be used uninitialized in this function [-Wuninitialized]

Initialize ut and change error handling from adis16080_read_raw().

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
 drivers/staging/iio/gyro/adis16080_core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/gyro/adis16080_core.c b/drivers/staging/iio/gyro/adis16080_core.c
index 1815490..e0b2a29 100644
--- a/drivers/staging/iio/gyro/adis16080_core.c
+++ b/drivers/staging/iio/gyro/adis16080_core.c
@@ -82,7 +82,7 @@ static int adis16080_read_raw(struct iio_dev *indio_dev,
 			     long mask)
 {
 	int ret = -EINVAL;
-	u16 ut;
+	u16 ut = 0;
 	/* Take the iio_dev status lock */
 
 	mutex_lock(&indio_dev->mlock);
@@ -94,7 +94,7 @@ static int adis16080_read_raw(struct iio_dev *indio_dev,
 		if (ret < 0)
 			break;
 		ret = adis16080_spi_read(indio_dev, &ut);
-		if (ret < 0)
+		if (ret)
 			break;
 		*val = ut;
 		ret = IIO_VAL_INT;
-- 
1.7.7.3


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

end of thread, other threads:[~2012-02-14 17:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-14 14:35 [PATCH] adis16080: fix compiler -Wuninitialized Danny Kukawka
2012-02-14 15:04 ` Dan Carpenter
2012-02-14 15:18   ` Jonathan Cameron
2012-02-14 17:36     ` Danny Kukawka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox