diff options
author | Nathan Chancellor <nathan@kernel.org> | 2023-08-29 16:35:06 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-08-31 03:13:40 +0200 |
commit | d4781807f0505526e293802d8509f31c4dfb8f54 (patch) | |
tree | ec93a8e1555f1dfdc183e5b81b7c3a2d5a45efcf /drivers/scsi | |
parent | scsi: fnic: Remove unused functions fnic_scsi_host_start/end_tag() (diff) | |
download | linux-d4781807f0505526e293802d8509f31c4dfb8f54.tar.xz linux-d4781807f0505526e293802d8509f31c4dfb8f54.zip |
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: 27177862de96 ("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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_nvme.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 04e02de36100..db753d712991 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -1180,12 +1180,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) { |