2021-08-20 03:09:12

by CGEL

[permalink] [raw]
Subject: [PATCH linux-next] scsi: megaraid: fix Coccinelle warnings

From: jing yangyang <[email protected]>

WARNING !A || A && B is equivalent to !A || B

This issue was detected with the help of Coccinelle.

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: jing yangyang <[email protected]>
---
drivers/scsi/megaraid/megaraid_sas_base.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index e4298bf..17c87ac 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -8773,8 +8773,7 @@ int megasas_update_device_list(struct megasas_instance *instance,

if (event_type & SCAN_VD_CHANNEL) {
if (!instance->requestorId ||
- (instance->requestorId &&
- megasas_get_ld_vf_affiliation(instance, 0))) {
+ megasas_get_ld_vf_affiliation(instance, 0)) {
dcmd_ret = megasas_ld_list_query(instance,
MR_LD_QUERY_TYPE_EXPOSED_TO_HOST);
if (dcmd_ret != DCMD_SUCCESS)
--
1.8.3.1



2021-08-20 08:39:33

by Sumit Saxena

[permalink] [raw]
Subject: Re: [PATCH linux-next] scsi: megaraid: fix Coccinelle warnings

On Fri, Aug 20, 2021 at 8:38 AM CGEL <[email protected]> wrote:
>
> From: jing yangyang <[email protected]>
>
> WARNING !A || A && B is equivalent to !A || B
>
> This issue was detected with the help of Coccinelle.
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: jing yangyang <[email protected]>
Acked-by: Sumit Saxena <[email protected]>


Attachments:
smime.p7s (4.11 kB)
S/MIME Cryptographic Signature

2021-09-14 03:45:11

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH linux-next] scsi: megaraid: fix Coccinelle warnings

On Thu, 19 Aug 2021 20:08:05 -0700, CGEL wrote:

> From: jing yangyang <[email protected]>
>
> WARNING !A || A && B is equivalent to !A || B
>
> This issue was detected with the help of Coccinelle.
>
>
> [...]

Applied to 5.15/scsi-fixes, thanks!

[1/1] scsi: megaraid: fix Coccinelle warnings
https://git.kernel.org/mkp/scsi/c/17dfd54d391e

--
Martin K. Petersen Oracle Linux Engineering