patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: qla2xxx: Fix unused variable warning in qla2xxx_process_purls_pkt()
@ 2023-08-29 14:35 Nathan Chancellor
  2023-08-30  6:18 ` Nilesh Javali
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Nathan Chancellor @ 2023-08-29 14:35 UTC (permalink / raw)
  To: njavali, GR-QLogic-Storage-Upstream, martin.petersen
  Cc: jejb, linux-scsi, patches, Stephen Rothwell, kernel test robot,
	Nathan Chancellor

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>
---
 drivers/scsi/qla2xxx/qla_nvme.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 62a67662cbf3..f9f4a7da2ed6 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) {

---
base-commit: 15924b0503630016dee4dbb945a8df4df659070b
change-id: 20230829-qla_nvme-fix-unused-fcport-5aae495edbf0

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-09-05 11:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-29 14:35 [PATCH] scsi: qla2xxx: Fix unused variable warning in qla2xxx_process_purls_pkt() Nathan Chancellor
2023-08-30  6:18 ` Nilesh Javali
2023-08-30 19:35 ` Bart Van Assche
2023-08-31  1:13 ` Martin K. Petersen
2023-09-05 10:18 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).