Skip to content

Commit d478180

Browse files
nathanchancemartinkpetersen
authored andcommitted
scsi: qla2xxx: Fix unused variable warning in qla2xxx_process_purls_pkt()
When CONFIG_NVME_FC is not set, fcport is unused: drivers/scsi/qla2xxx/qla_nvme.c: In function 'qla2xxx_process_purls_pkt': drivers/scsi/qla2xxx/qla_nvme.c:1183:20: warning: unused variable 'fcport' [-Wunused-variable] 1183 | fc_port_t *fcport = uctx->fcport; | ^~~~~~ While this preprocessor usage could be converted to a normal if statement to allow the compiler to always see fcport as used, it is equally easy to just eliminate the fcport variable and use uctx->fcport directly. Fixes: 2717786 ("scsi: qla2xxx: Fix nvme_fc_rcv_ls_req() undefined error") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Closes: https://lore.kernel.org/linux-next/20230828131304.269a2a40@canb.auug.org.au/ Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202308290833.sKkoSSeO-lkp@intel.com/ Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20230829-qla_nvme-fix-unused-fcport-v1-1-51c7560ecaee@kernel.org Acked-by: Nilesh Javali <njavali@marvell.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent e7cf3a3 commit d478180

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/scsi/qla2xxx/qla_nvme.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,12 +1180,11 @@ static void
11801180
qla2xxx_process_purls_pkt(struct scsi_qla_host *vha, struct purex_item *item)
11811181
{
11821182
struct qla_nvme_unsol_ctx *uctx = item->purls_context;
1183-
fc_port_t *fcport = uctx->fcport;
11841183
struct qla_nvme_lsrjt_pt_arg a;
11851184
int ret = 1;
11861185

11871186
#if (IS_ENABLED(CONFIG_NVME_FC))
1188-
ret = nvme_fc_rcv_ls_req(fcport->nvme_remote_port, &uctx->lsrsp,
1187+
ret = nvme_fc_rcv_ls_req(uctx->fcport->nvme_remote_port, &uctx->lsrsp,
11891188
&item->iocb, item->size);
11901189
#endif
11911190
if (ret) {

0 commit comments

Comments
 (0)