mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lee Duncan <lduncan@suse.com>
To: Deepak R Varma <drv@mailo.com>,
	Nilesh Javali <njavali@marvell.com>,
	GR-QLogic-Storage-Upstream@marvell.com,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Saurabh Singh Sengar <ssengar@microsoft.com>,
	Praveen Kumar <kumarpraveen@linux.microsoft.com>
Subject: Re: [PATCH] scsi: qla2xxx: Simplify if condition evaluation
Date: Wed, 11 Jan 2023 19:26:32 -0800	[thread overview]
Message-ID: <54c45867-e9a5-fb6b-d242-0a02305e70d4@suse.com> (raw)
In-Reply-To: <Y78HoiOWkc3RrEgN@ubun2204.myguest.virtualbox.org>

On 1/11/23 11:01, Deepak R Varma 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@mailo.com>
> ---
> Please note: Change is compile tested only.
> 
>   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..bf6aacf4dbd1 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,

It seems like you missed something in the translation. You left of the 
"!own" in your replacement. You are translating (!A || A && B) as (A && B).

--
Lee Duncan


  reply	other threads:[~2023-01-12  3:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-11 19:01 Deepak R Varma
2023-01-12  3:26 ` Lee Duncan [this message]
2023-01-12  4:26   ` Deepak R Varma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54c45867-e9a5-fb6b-d242-0a02305e70d4@suse.com \
    --to=lduncan@suse.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=drv@mailo.com \
    --cc=jejb@linux.ibm.com \
    --cc=kumarpraveen@linux.microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=njavali@marvell.com \
    --cc=ssengar@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®