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] [day] [month] [year] [list]
Message-ID: <520ACDB9-9DB3-4189-93B4-D1B0B0E76457@oracle.com>
Date:   Mon, 23 Jan 2023 19:19:43 +0000
From:   Himanshu Madhani <himanshu.madhani@...cle.com>
To:     Deepak R Varma <drv@...lo.com>
CC:     Nilesh Javali <njavali@...vell.com>,
        GR-QLogic-Storage-Upstream <GR-QLogic-Storage-Upstream@...vell.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        Martin Petersen <martin.petersen@...cle.com>,
        linux-scsi <linux-scsi@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        Saurabh Singh Sengar <ssengar@...rosoft.com>,
        Praveen Kumar <kumarpraveen@...ux.microsoft.com>
Subject: Re: [PATCH v2] scsi: qla2xxx: Simplify if condition evaluation



> On Jan 11, 2023, at 10:26 PM, Deepak R Varma <drv@...lo.com> wrote:
> 
> A logical evaluation of type (!A || A && B) can be simplified as
> (!A || B).
> Improvement by suggested by excluded_middle.cocci Coccinelel semantic
> patch.
> 
> Signed-off-by: Deepak R Varma <drv@...lo.com>
> ---
> Please note: Change is compile tested only.
> 
> Changes in v2:
>   - Correct the if evaluation from (A && B) to (!A || B). Feedback
>     from Lee Duncan <lduncan@...e.com>
> 
> drivers/scsi/qla2xxx/qla_target.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
> index 548f22705ddc..4f104fbfe55d 100644
> --- a/drivers/scsi/qla2xxx/qla_target.c
> +++ b/drivers/scsi/qla2xxx/qla_target.c
> @@ -1028,8 +1028,7 @@ void qlt_free_session_done(struct work_struct *work)
> }
> 
> if (ha->flags.edif_enabled &&
> -    (!own || (own &&
> -      own->iocb.u.isp24.status_subcode == ELS_PLOGI))) {
> + (!own || own->iocb.u.isp24.status_subcode == ELS_PLOGI)) {
> sess->edif.authok = 0;
> if (!ha->flags.host_shutting_down) {
> ql_dbg(ql_dbg_edif, vha, 0x911e,
> -- 
> 2.34.1
> 
> 
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@...cle.com <mailto:himanshu.madhani@...cle.com>>

-- 
Himanshu Madhani Oracle Linux Engineering

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ