Skip to content

Commit

Permalink
qla2x00t-32gbit: Fix unused variable warning in qla2xxx_process_purls…
Browse files Browse the repository at this point in the history
…_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: 27177862de96 ("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]>
[ commit d4781807f050 upstream ]
  • Loading branch information
lnocturno committed Oct 10, 2023
1 parent 4dd1f3f commit 785ac55
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions qla2x00t-32gbit/qla_nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1132,12 +1132,11 @@ static void
qla2xxx_process_purls_pkt(struct scsi_qla_host *vha, struct purex_item *item)
{
struct qla_nvme_unsol_ctx *uctx = item->purls_context;
fc_port_t *fcport = uctx->fcport;
struct qla_nvme_lsrjt_pt_arg a;
int ret = 1;

#if (IS_ENABLED(CONFIG_NVME_FC))
ret = nvme_fc_rcv_ls_req(fcport->nvme_remote_port, &uctx->lsrsp,
ret = nvme_fc_rcv_ls_req(uctx->fcport->nvme_remote_port, &uctx->lsrsp,
&item->iocb, item->size);
#endif
if (ret) {
Expand Down

0 comments on commit 785ac55

Please sign in to comment.