From: kernel test robot <lkp@intel.com>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: clang-built-linux@googlegroups.com, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org
Subject: [mcgrof:20210818-add-disk-error-handling-v2 137/160] drivers/block/rsxx/dev.c:200:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false
Date: Thu, 19 Aug 2021 06:49:37 +0800 [thread overview]
Message-ID: <202108190626.VhgoUe4l-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4293 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git 20210818-add-disk-error-handling-v2
head: 0517c8bf82eb7da58caada94869afb0957f57c81
commit: 75577f3e8b2f2a343829cb35edbdf0f138fc9000 [137/160] block/rsxx: add error handling support for add_disk()
config: i386-randconfig-r022-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/commit/?id=75577f3e8b2f2a343829cb35edbdf0f138fc9000
git remote add mcgrof https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git
git fetch --no-tags mcgrof 20210818-add-disk-error-handling-v2
git checkout 75577f3e8b2f2a343829cb35edbdf0f138fc9000
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/block/rsxx/dev.c:200:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (enable_blkdev) {
^~~~~~~~~~~~~
drivers/block/rsxx/dev.c:212:6: note: uninitialized use occurs here
if (err)
^~~
drivers/block/rsxx/dev.c:200:2: note: remove the 'if' if its condition is always true
if (enable_blkdev) {
^~~~~~~~~~~~~~~~~~~
drivers/block/rsxx/dev.c:195:9: note: initialize the variable 'err' to silence this warning
int err;
^
= 0
1 warning generated.
vim +200 drivers/block/rsxx/dev.c
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 192
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 193 int rsxx_attach_dev(struct rsxx_cardinfo *card)
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 194 {
75577f3e8b2f2a Luis Chamberlain 2021-07-13 195 int err;
75577f3e8b2f2a Luis Chamberlain 2021-07-13 196
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 197 mutex_lock(&card->dev_lock);
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 198
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 199 /* The block device requires the stripe size from the config. */
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 @200 if (enable_blkdev) {
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 201 if (card->config_valid)
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 202 set_capacity(card->gendisk, card->size8 >> 9);
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 203 else
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 204 set_capacity(card->gendisk, 0);
75577f3e8b2f2a Luis Chamberlain 2021-07-13 205 err = device_add_disk(CARD_TO_DEV(card), card->gendisk, NULL);
75577f3e8b2f2a Luis Chamberlain 2021-07-13 206 if (err == 0)
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 207 card->bdev_attached = 1;
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 208 }
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 209
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 210 mutex_unlock(&card->dev_lock);
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 211
75577f3e8b2f2a Luis Chamberlain 2021-07-13 212 if (err)
75577f3e8b2f2a Luis Chamberlain 2021-07-13 213 blk_cleanup_disk(card->gendisk);
75577f3e8b2f2a Luis Chamberlain 2021-07-13 214
75577f3e8b2f2a Luis Chamberlain 2021-07-13 215 return err;
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 216 }
8722ff8cdbfac9 josh.h.morris@us.ibm.com 2013-02-05 217
:::::: The code at line 200 was first introduced by commit
:::::: 8722ff8cdbfac9c1b20e67bb067b455c48cb8e93 block: IBM RamSan 70/80 device driver
:::::: TO: josh.h.morris@us.ibm.com <josh.h.morris@us.ibm.com>
:::::: CC: Jens Axboe <axboe@kernel.dk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40736 bytes --]
reply other threads:[~2021-08-18 22:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202108190626.VhgoUe4l-lkp@intel.com \
--to=lkp@intel.com \
--cc=clang-built-linux@googlegroups.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
/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
all inboxes | Powered by JetHome®