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 <[email protected]> Closes: https://lore.kernel.org/linux-next/[email protected]/ Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Nathan Chancellor <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Nilesh Javali <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
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)