lkml.org 
[lkml]   [2022]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] scsi: qla2xxx: Remove a useless variable in qla24xx_async_gnnft_done()
Date
'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(-)

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);
--
2.34.1
\
 
 \ /
  Last update: 2022-11-19 12:26    [W:0.036 / U:0.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site