diff mbox series

scsi: qla2xxx: Simplify the calculation of variables

Message ID 1611650554-33019-1-git-send-email-abaci-bugfix@linux.alibaba.com (mailing list archive)
State Accepted
Headers show
Series scsi: qla2xxx: Simplify the calculation of variables | expand

Commit Message

Abaci Team Jan. 26, 2021, 8:42 a.m. UTC
Fix the following coccicheck warnings:

./drivers/scsi/qla2xxx/qla_nvme.c:288:24-26: WARNING !A || A && B is
equivalent to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
---
 drivers/scsi/qla2xxx/qla_nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Himanshu Madhani Jan. 27, 2021, 8:01 p.m. UTC | #1
> On Jan 26, 2021, at 2:42 AM, Jiapeng Zhong <abaci-bugfix@linux.alibaba.com> wrote:
> 
> Fix the following coccicheck warnings:
> 
> ./drivers/scsi/qla2xxx/qla_nvme.c:288:24-26: WARNING !A || A && B is
> equivalent to !A || B.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
> ---
> drivers/scsi/qla2xxx/qla_nvme.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
> index eab559b..38196b2 100644
> --- a/drivers/scsi/qla2xxx/qla_nvme.c
> +++ b/drivers/scsi/qla2xxx/qla_nvme.c
> @@ -285,7 +285,7 @@ static int qla_nvme_ls_req(struct nvme_fc_local_port *lport,
> 	srb_t           *sp;
> 
> 
> -	if (!fcport || (fcport && fcport->deleted))
> +	if (!fcport || fcport->deleted)
> 		return rval;
> 
> 	vha = fcport->vha;
> -- 
> 1.8.3.1
> 

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

--
Himanshu Madhani	 Oracle Linux Engineering
Martin K. Petersen Jan. 29, 2021, 6:34 p.m. UTC | #2
Jiapeng,

> Fix the following coccicheck warnings:
>
> ./drivers/scsi/qla2xxx/qla_nvme.c:288:24-26: WARNING !A || A && B is
> equivalent to !A || B.

Applied to 5.12/scsi-staging, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index eab559b..38196b2 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -285,7 +285,7 @@  static int qla_nvme_ls_req(struct nvme_fc_local_port *lport,
 	srb_t           *sp;
 
 
-	if (!fcport || (fcport && fcport->deleted))
+	if (!fcport || fcport->deleted)
 		return rval;
 
 	vha = fcport->vha;