[bvanassche:scsi-move-scsi-pointer 25/45] drivers/scsi/megaraid.c:1075:9: warning: variable 'scb' is uninitialized when used here

From: kernel test robot
Date: Fri Jan 21 2022 - 03:21:08 EST


tree: https://github.com/bvanassche/linux scsi-move-scsi-pointer
head: 1f9cda056e9fc3b2f08455c8ab1a2d85b52df093
commit: 7f5c4ca6df22ad432a2631b6cdd374f40a249746 [25/45] megaraid: Stop using the SCSI pointer
config: i386-randconfig-a013 (https://download.01.org/0day-ci/archive/20220121/202201211656.z3YanySW-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d4baf3b1322b84816aa623d8e8cb45a49cb68b84)
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://github.com/bvanassche/linux/commit/7f5c4ca6df22ad432a2631b6cdd374f40a249746
git remote add bvanassche https://github.com/bvanassche/linux
git fetch --no-tags bvanassche scsi-move-scsi-pointer
git checkout 7f5c4ca6df22ad432a2631b6cdd374f40a249746
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/scsi/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> drivers/scsi/megaraid.c:1075:9: warning: variable 'scb' is uninitialized when used here [-Wuninitialized]
if (!(scb->state & SCB_ISSUED) && issue_scb(adapter, scb) != 0)
^~~
drivers/scsi/megaraid.c:1073:13: note: initialize the variable 'scb' to silence this warning
scb_t *scb;
^
= NULL
1 warning generated.


vim +/scb +1075 drivers/scsi/megaraid.c

1065
1066 static void
1067 __mega_runpendq(adapter_t *adapter)
1068 {
1069 struct megaraid_cmd_priv *pos, *next;
1070
1071 /* Issue all pending commands to the card */
1072 list_for_each_entry_safe(pos, next, &adapter->pending_list, entry) {
1073 scb_t *scb;
1074
> 1075 if (!(scb->state & SCB_ISSUED) && issue_scb(adapter, scb) != 0)
1076 return;
1077 }
1078 }
1079

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx