scsi: qla2xxx: Remove a useless variable in qla24xx_async_gnnft_done()

Message ID 0a98ea98784299393042e9e7b2cd03ab17b13f94.1668857101.git.christophe.jaillet@wanadoo.fr
State New
Headers
Series scsi: qla2xxx: Remove a useless variable in qla24xx_async_gnnft_done() |

Commit Message

Christophe JAILLET Nov. 19, 2022, 11:25 a.m. UTC
  'dup' is useless. It is only 1 if 'dup_cnt' is 1 or more.
It is as easy to test 'dup_cnt' directly and remove 'dup'.

This slightly simplify the code.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/scsi/qla2xxx/qla_gs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Patch

diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index 0afd6cee7113..8caa6c6ed479 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -3467,7 +3467,7 @@  void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
 	struct fab_scan_rp *rp, *trp;
 	unsigned long flags;
 	u8 recheck = 0;
-	u16 dup = 0, dup_cnt = 0;
+	u16 dup_cnt = 0;
 
 	ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0xffff,
 	    "%s enter\n", __func__);
@@ -3526,7 +3526,6 @@  void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
 		for (k = i + 1; k < vha->hw->max_fibre_devices; k++) {
 			trp = &vha->scan.l[k];
 			if (rp->id.b24 == trp->id.b24) {
-				dup = 1;
 				dup_cnt++;
 				ql_dbg(ql_dbg_disc + ql_dbg_verbose,
 				    vha, 0xffff,
@@ -3588,7 +3587,7 @@  void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
 		}
 	}
 
-	if (dup) {
+	if (dup_cnt) {
 		ql_log(ql_log_warn, vha, 0xffff,
 		    "Detected %d duplicate NPORT ID(s) from switch data base\n",
 		    dup_cnt);