'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@xxxxxxxxxx> --- 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