From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Michael Hennerich <michael.hennerich@analog.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
"Nuno Sá" <nuno.sa@analog.com>
Subject: [jic23-iio:testing 149/150] drivers/iio/dac/ad5593r.c:87 ad5593r_gpio_read() error: uninitialized symbol 'val'.
Date: Fri, 16 Sep 2022 09:55:34 +0300 [thread overview]
Message-ID: <202209160614.IE7ciPMN-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git testing
head: 62a6e699f4669b2c51f408273756f93b21c9f1a1
commit: 53b6e3b2164c5807669fbf6b3df0e1494b4d03b8 [149/150] iio: dac: ad5593r: Fix i2c read protocol requirements
config: x86_64-randconfig-m001
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/iio/dac/ad5593r.c:87 ad5593r_gpio_read() error: uninitialized symbol 'val'.
vim +/val +87 drivers/iio/dac/ad5593r.c
56ca9db862bf3d7 Paul Cercueil 2016-04-05 79 static int ad5593r_gpio_read(struct ad5592r_state *st, u8 *value)
56ca9db862bf3d7 Paul Cercueil 2016-04-05 80 {
56ca9db862bf3d7 Paul Cercueil 2016-04-05 81 struct i2c_client *i2c = to_i2c_client(st->dev);
53b6e3b2164c580 Michael Hennerich 2022-09-13 82 u16 val;
53b6e3b2164c580 Michael Hennerich 2022-09-13 83 int ret;
56ca9db862bf3d7 Paul Cercueil 2016-04-05 84
53b6e3b2164c580 Michael Hennerich 2022-09-13 85 ret = ad5593r_read_word(i2c, AD5593R_MODE_GPIO_READBACK, &val);
56ca9db862bf3d7 Paul Cercueil 2016-04-05 86
56ca9db862bf3d7 Paul Cercueil 2016-04-05 @87 *value = (u8) val;
In the original code the error checking prevented reading uninitialized
variables. It's not really a problem, because ad5593r_read_word() can't
actually fail but, you know? Technically the checker is correct.
56ca9db862bf3d7 Paul Cercueil 2016-04-05 88
53b6e3b2164c580 Michael Hennerich 2022-09-13 89 return ret;
56ca9db862bf3d7 Paul Cercueil 2016-04-05 90 }
next reply other threads:[~2022-09-16 6:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-16 6:55 Dan Carpenter [this message]
2022-09-16 7:11 ` [jic23-iio:testing 149/150] drivers/iio/dac/ad5593r.c:87 ad5593r_gpio_read() error: uninitialized symbol 'val' Sa, Nuno
2022-09-16 8:38 ` Jonathan Cameron
2022-09-16 8:58 ` Sa, Nuno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202209160614.IE7ciPMN-lkp@intel.com \
--to=dan.carpenter@oracle.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=michael.hennerich@analog.com \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox