linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: imu: adis16400: fix compiler warnings
@ 2019-10-08  8:51 Alexandru Ardelean
  2019-10-12 11:48 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandru Ardelean @ 2019-10-08  8:51 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, Alexandru Ardelean

GCC 8 complains about plenty of 'maybe-uninitialized' warnings.
This patch fixes all of them.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 drivers/iio/imu/adis16400.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/imu/adis16400.c b/drivers/iio/imu/adis16400.c
index e042a2aabf6b..d0b7dce798f4 100644
--- a/drivers/iio/imu/adis16400.c
+++ b/drivers/iio/imu/adis16400.c
@@ -325,7 +325,7 @@ static struct adis_burst adis16400_burst = {
 static int adis16334_get_freq(struct adis16400_state *st)
 {
 	int ret;
-	uint16_t t;
+	uint16_t t = 0;
 
 	ret = __adis_read_reg_16(&st->adis, ADIS16400_SMPL_PRD, &t);
 	if (ret < 0)
@@ -338,7 +338,7 @@ static int adis16334_get_freq(struct adis16400_state *st)
 
 static int adis16334_set_freq(struct adis16400_state *st, unsigned int freq)
 {
-	unsigned int t;
+	unsigned int t = 0;
 
 	if (freq < 819200)
 		t = ilog2(819200 / freq);
@@ -357,7 +357,7 @@ static int adis16334_set_freq(struct adis16400_state *st, unsigned int freq)
 static int adis16400_get_freq(struct adis16400_state *st)
 {
 	int sps, ret;
-	uint16_t t;
+	uint16_t t = 0;
 
 	ret = __adis_read_reg_16(&st->adis, ADIS16400_SMPL_PRD, &t);
 	if (ret < 0)
@@ -408,7 +408,7 @@ static const unsigned int adis16400_3db_divisors[] = {
 static int __adis16400_set_filter(struct iio_dev *indio_dev, int sps, int val)
 {
 	struct adis16400_state *st = iio_priv(indio_dev);
-	uint16_t val16;
+	uint16_t val16 = 0;
 	int i, ret;
 
 	for (i = ARRAY_SIZE(adis16400_3db_divisors) - 1; i >= 1; i--) {
@@ -554,7 +554,7 @@ static int adis16400_read_raw(struct iio_dev *indio_dev,
 {
 	struct adis16400_state *st = iio_priv(indio_dev);
 	struct mutex *slock = &st->adis.state_lock;
-	int16_t val16;
+	int16_t val16 = 0;
 	int ret;
 
 	switch (info) {
-- 
2.20.1


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

end of thread, other threads:[~2019-10-12 12:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-08  8:51 [PATCH] iio: imu: adis16400: fix compiler warnings Alexandru Ardelean
2019-10-12 11:48 ` Jonathan Cameron
2019-10-12 12:06   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).