From patchwork Sat Nov 19 11:25:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 23248 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp664476wrr; Sat, 19 Nov 2022 03:31:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf7uSnaa6lH17z3Kl0NsDVDMyZW69inP2v5TOHzdx+AYkHtcLX6Ng72lp/171nBb7EGkPdO2 X-Received: by 2002:a05:6402:294d:b0:467:6b55:3cf5 with SMTP id ed13-20020a056402294d00b004676b553cf5mr9536402edb.22.1668857516737; Sat, 19 Nov 2022 03:31:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668857516; cv=none; d=google.com; s=arc-20160816; b=0/JcFCZxrvDP1g0eARlT+i2sfDqwJffyApI7afnSSM+M0RktHKKjZadAwAOdb8ej2H auO74g2Kaj5I9omoz6BWr9n+TfvwTXhaobA4oliZ96hWl8cg8iqR1EyjX4kLvq5MpzC5 1ORagkLCVziQMSgnm41pQV7loH51Be93IbWgl+RIy89pf5Skvl8cAHMn19x3lHhZqpL3 Z8rIXpUBUJMF8Pi6DNtSc/5T4gbqdmQ9BuXpsUxXMn9peRrV9Cut7zTNO6YFn9XKTt+T 1Yn35P8sxjrkoPzUSNZhztVAPu3FG1RomTqiumLpo8We1Y1xcRxvliQoDmzsL1rRP+JW 9HBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=BpHQ09E/tBvMhk7IZdLns+XPKFUWHmbOjPE241Qx8RQ=; b=0m4D2xQBSNkANLcNswniAxp4SznaSowjSlf6k5wsZNS41OIlhotuZQZtxkN1qTQWeX 86KEsJFXDOZQ0C0iFAERcEchu5mDi4j4vjtxjKi0bEt0qmTQHayoVnS5MyII4qi3WoDI 64LEWgghtlnD28sB/tcl9FDsttBsTXH0f4g2K6DQD217hzEC0veCUGjze5YBxhG2cZY6 neMSXs8vrMqMYY5LJXueqddNV3KBLGzfm8WfmzEiphcNwmfrU5PnVkvMQ7xJRVFpcG5T +bzcze+PCMqHXUo7icHW1AJXwDbIPRy6wCa7U8i5F2EpKP+5v/OS264JM42PgMyLxXW+ 9XUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du14-20020a17090772ce00b0078decbc3f73si5601456ejc.460.2022.11.19.03.31.31; Sat, 19 Nov 2022 03:31:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232547AbiKSLZR (ORCPT + 99 others); Sat, 19 Nov 2022 06:25:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231959AbiKSLZQ (ORCPT ); Sat, 19 Nov 2022 06:25:16 -0500 Received: from smtp.smtpout.orange.fr (smtp-19.smtpout.orange.fr [80.12.242.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2BEE7FC32 for ; Sat, 19 Nov 2022 03:25:12 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id wLy8o8HMFb9QWwLy8oM3lt; Sat, 19 Nov 2022 12:25:10 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 19 Nov 2022 12:25:10 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-scsi@vger.kernel.org Subject: [PATCH] scsi: qla2xxx: Remove a useless variable in qla24xx_async_gnnft_done() Date: Sat, 19 Nov 2022 12:25:07 +0100 Message-Id: <0a98ea98784299393042e9e7b2cd03ab17b13f94.1668857101.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749923939533846888?= X-GMAIL-MSGID: =?utf-8?q?1749923939533846888?= '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 --- 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);