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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 27 Sep 2018 11:15:42 +0000
From:   "Rangankar, Manish" <Manish.Rangankar@...ium.com>
To:     Colin King <colin.king@...onical.com>,
        Dept-Eng QLogic Storage Upstream 
        <QLogic-Storage-Upstream@...ium.com>,
        "James E . J . Bottomley" <jejb@...ux.vnet.ibm.com>,
        "Martin K . Petersen" <martin.petersen@...cle.com>,
        "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>
CC:     "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] scsi: qla4xxx: remove redundant check on drvr_wait


> -----Original Message-----
> From: Colin King <colin.king@...onical.com>
> Sent: Wednesday, September 26, 2018 6:39 PM
> To: Dept-Eng QLogic Storage Upstream <QLogic-Storage-
> Upstream@...ium.com>; James E . J . Bottomley <jejb@...ux.vnet.ibm.com>;
> Martin K . Petersen <martin.petersen@...cle.com>; linux-scsi@...r.kernel.org
> Cc: kernel-janitors@...r.kernel.org; linux-kernel@...r.kernel.org
> Subject: [PATCH] scsi: qla4xxx: remove redundant check on drvr_wait
> 
> External Email
> 
> From: Colin Ian King <colin.king@...onical.com>
> 
> The check for a non-zero drvr_wait is redundant as the same check is performed
> earlier in the outer while loop, the inner check will always be true if we reached
> this point inside the while loop.
> Remove the redundant if check.
> 
> Detected by cppcheck:
> (warning) Identical inner 'if' condition is always true.
> 
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> ---
>  drivers/scsi/qla4xxx/ql4_init.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c index
> 52b1a0bc93c9..1ef74aa2d00a 100644
> --- a/drivers/scsi/qla4xxx/ql4_init.c
> +++ b/drivers/scsi/qla4xxx/ql4_init.c
> @@ -766,12 +766,10 @@ int ql4xxx_lock_drvr_wait(struct scsi_qla_host *a)
>         while (drvr_wait) {
>                 if (ql4xxx_lock_drvr(a) == 0) {
>                         ssleep(QL4_LOCK_DRVR_SLEEP);
> -                       if (drvr_wait) {
> -                               DEBUG2(printk("scsi%ld: %s: Waiting for "
> -                                             "Global Init Semaphore(%d)...\n",
> -                                             a->host_no,
> -                                             __func__, drvr_wait));
> -                       }
> +                       DEBUG2(printk("scsi%ld: %s: Waiting for "
> +                                     "Global Init Semaphore(%d)...\n",
> +                                     a->host_no,
> +                                     __func__, drvr_wait));
>                         drvr_wait -= QL4_LOCK_DRVR_SLEEP;
>                 } else {
>                         DEBUG2(printk("scsi%ld: %s: Global Init Semaphore "
> --
> 2.17.1

Thanks,

Acked-by: Manish Rangankar <Manish.Rangankar@...ium.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ