2021-04-14 15:41:48

by Jiabing Wan

[permalink] [raw]
Subject: [PATCH] scsi: qla4xxx: Simplify judgement condition

Fix the following coccicheck warning:

./drivers/scsi/qla4xxx/ql4_83xx.c:475:23-25: WARNING !A || A && B is
equivalent to !A || B

Signed-off-by: Wan Jiabing <[email protected]>
---
drivers/scsi/qla4xxx/ql4_83xx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_83xx.c b/drivers/scsi/qla4xxx/ql4_83xx.c
index 5f56122f6664..db41d90a5b6e 100644
--- a/drivers/scsi/qla4xxx/ql4_83xx.c
+++ b/drivers/scsi/qla4xxx/ql4_83xx.c
@@ -472,8 +472,7 @@ int qla4_83xx_can_perform_reset(struct scsi_qla_host *ha)
} else if (device_map[i].device_type == ISCSI_CLASS) {
if (drv_active & (1 << device_map[i].func_num)) {
if (!iscsi_present ||
- (iscsi_present &&
- (iscsi_func_low > device_map[i].func_num)))
+ iscsi_func_low > device_map[i].func_num)
iscsi_func_low = device_map[i].func_num;

iscsi_present++;
--
2.25.1


2021-05-11 03:29:08

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: qla4xxx: Simplify judgement condition

On Wed, 14 Apr 2021 20:17:26 +0800, Wan Jiabing wrote:

> Fix the following coccicheck warning:
>
> ./drivers/scsi/qla4xxx/ql4_83xx.c:475:23-25: WARNING !A || A && B is
> equivalent to !A || B

Applied to 5.14/scsi-queue, thanks!

[1/1] scsi: qla4xxx: Simplify judgement condition
https://git.kernel.org/mkp/scsi/c/ed26297d14b7

--
Martin K. Petersen Oracle Linux Engineering