linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: accel: fxls8962af: Initialize return value
@ 2021-07-09  3:15 Souptick Joarder
  2021-07-09  3:36 ` Fabio Estevam
  0 siblings, 1 reply; 6+ messages in thread
From: Souptick Joarder @ 2021-07-09  3:15 UTC (permalink / raw)
  To: jic23, lars, sean, andriy.shevchenko, linus.walleij
  Cc: linux-iio, linux-kernel, Souptick Joarder, kernel test robot,
	Dan Carpenter

kernel test robot throws below warning ->

smatch warnings:
drivers/iio/accel/fxls8962af-core.c:640
fxls8962af_i2c_raw_read_errata3() error: uninitialized symbol 'ret'.

Initialize it.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
---
 drivers/iio/accel/fxls8962af-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c
index 078d87865fde..8af1c8f58e83 100644
--- a/drivers/iio/accel/fxls8962af-core.c
+++ b/drivers/iio/accel/fxls8962af-core.c
@@ -628,7 +628,7 @@ static int fxls8962af_i2c_raw_read_errata3(struct fxls8962af_data *data,
 					   u16 *buffer, int samples,
 					   int sample_length)
 {
-	int i, ret;
+	int i, ret = -EINVAL;
 
 	for (i = 0; i < samples; i++) {
 		ret = regmap_raw_read(data->regmap, FXLS8962AF_BUF_X_LSB,
-- 
2.25.1


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

end of thread, other threads:[~2021-07-10 17:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09  3:15 [PATCH] iio: accel: fxls8962af: Initialize return value Souptick Joarder
2021-07-09  3:36 ` Fabio Estevam
2021-07-09  6:48   ` Sean Nyekjaer
2021-07-10 17:16     ` Fabio Estevam
     [not found]   ` <CAFqt6zZ3WOv6sv5iVgkbYBhnxvv=t1pE8ZxEiC7=j5qugvy=NA@mail.gmail.com>
2021-07-09 14:35     ` Sean Nyekjaer
2021-07-09 17:12       ` Dan Carpenter

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).