drivers/scsi/qla2xxx/qla_init.c:171:17: warning: variable 'bail' set but not used

From: kernel test robot
Date: Tue Aug 09 2022 - 19:12:11 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 15205c2829ca2cbb5ece5ceaafe1171a8470e62b
commit: 63fa7f2644b4b48e1913af33092c044bf48e9321 scsi: qla2xxx: Fix imbalance vha->vref_count
date: 3 weeks ago
config: parisc-buildonly-randconfig-r002-20220810 (https://download.01.org/0day-ci/archive/20220810/202208100749.O5lpvjoS-lkp@xxxxxxxxx/config)
compiler: hppa-linux-gcc (GCC) 12.1.0
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/torvalds/linux.git/commit/?id=63fa7f2644b4b48e1913af33092c044bf48e9321
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 63fa7f2644b4b48e1913af33092c044bf48e9321
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash drivers/scsi/qla2xxx/

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

All warnings (new ones prefixed by >>):

drivers/scsi/qla2xxx/qla_init.c: In function 'qla24xx_async_abort_cmd':
>> drivers/scsi/qla2xxx/qla_init.c:171:17: warning: variable 'bail' set but not used [-Wunused-but-set-variable]
171 | uint8_t bail;
| ^~~~
drivers/scsi/qla2xxx/qla_init.c: In function 'qla2x00_async_tm_cmd':
drivers/scsi/qla2xxx/qla_init.c:2023:17: warning: variable 'bail' set but not used [-Wunused-but-set-variable]
2023 | uint8_t bail;
| ^~~~


vim +/bail +171 drivers/scsi/qla2xxx/qla_init.c

164
165 int qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait)
166 {
167 scsi_qla_host_t *vha = cmd_sp->vha;
168 struct srb_iocb *abt_iocb;
169 srb_t *sp;
170 int rval = QLA_FUNCTION_FAILED;
> 171 uint8_t bail;
172
173 /* ref: INIT for ABTS command */
174 sp = qla2xxx_get_qpair_sp(cmd_sp->vha, cmd_sp->qpair, cmd_sp->fcport,
175 GFP_ATOMIC);
176 if (!sp)
177 return QLA_MEMORY_ALLOC_FAILED;
178
179 QLA_VHA_MARK_BUSY(vha, bail);
180 abt_iocb = &sp->u.iocb_cmd;
181 sp->type = SRB_ABT_CMD;
182 sp->name = "abort";
183 sp->qpair = cmd_sp->qpair;
184 sp->cmd_sp = cmd_sp;
185 if (wait)
186 sp->flags = SRB_WAKEUP_ON_COMP;
187
188 init_completion(&abt_iocb->u.abt.comp);
189 /* FW can send 2 x ABTS's timeout/20s */
190 qla2x00_init_async_sp(sp, 42, qla24xx_abort_sp_done);
191 sp->u.iocb_cmd.timeout = qla24xx_abort_iocb_timeout;
192
193 abt_iocb->u.abt.cmd_hndl = cmd_sp->handle;
194 abt_iocb->u.abt.req_que_no = cpu_to_le16(cmd_sp->qpair->req->id);
195
196 ql_dbg(ql_dbg_async, vha, 0x507c,
197 "Abort command issued - hdl=%x, type=%x\n", cmd_sp->handle,
198 cmd_sp->type);
199
200 rval = qla2x00_start_sp(sp);
201 if (rval != QLA_SUCCESS) {
202 /* ref: INIT */
203 kref_put(&sp->cmd_kref, qla2x00_sp_release);
204 return rval;
205 }
206
207 if (wait) {
208 wait_for_completion(&abt_iocb->u.abt.comp);
209 rval = abt_iocb->u.abt.comp_status == CS_COMPLETE ?
210 QLA_SUCCESS : QLA_ERR_FROM_FW;
211 /* ref: INIT */
212 kref_put(&sp->cmd_kref, qla2x00_sp_release);
213 }
214
215 return rval;
216 }
217

--
0-DAY CI Kernel Test Service
https://01.org/lkp