lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <0a98ea98784299393042e9e7b2cd03ab17b13f94.1668857101.git.christophe.jaillet@wanadoo.fr>
Date:   Sat, 19 Nov 2022 12:25:07 +0100
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     Nilesh Javali <njavali@...vell.com>,
        GR-QLogic-Storage-Upstream@...vell.com,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>
Cc:     linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        linux-scsi@...r.kernel.org
Subject: [PATCH] scsi: qla2xxx: Remove a useless variable in qla24xx_async_gnnft_done()

'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@...adoo.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ