Skip to contentSkip to conversation

scsi: smartpqi_init: fix boolean expression in pqi_device_remove_start

PATCH Applied Gustavo A. R. Silva 3 participants 3 messages Jan 3, 2019 – Jan 4, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: smartpqi_init: fix boolean expression in pqi_device_remove_start

Fix boolean expression by using logical AND operator '&&' instead of bitwise operator '&'.

This issue was detected with the help of Coccinelle.

Fixes 1e46731efd9c ("scsi: smartpqi: check for null device pointers")
---
 drivers/scsi/smartpqi/smartpqi_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/smartpqi/smartpqi_init.c +1 -1
index e2fa3f476227..40f58238ce4a 100644
@@ -323,7 +323,7 @@ static inline void pqi_device_remove_start(struct pqi_scsi_dev *device)
 static inline bool pqi_device_in_remove(struct pqi_ctrl_info *ctrl_info,
 					struct pqi_scsi_dev *device)
 {
-	return device->in_remove & !ctrl_info->in_shutdown;
+	return device->in_remove && !ctrl_info->in_shutdown;
 }
 
 static inline void pqi_schedule_rescan_worker_with_delay(
Signature · 1 line
2.20.1
maintainer Acked-by Don Brace on v1 1/1
#1 lore raw

-----Original Message-----
From: Gustavo A. R. Silva [mailto:[email protected]]
Sent: Thursday, January 3, 2019 10:48 AM
To: Mahesh Rajashekhara <[email protected]>; Don Brace <[email protected]>; James E.J. Bottomley <[email protected]>; Martin K. Petersen <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Gustavo A. R. Silva <[email protected]>
Subject: [PATCH] scsi: smartpqi_init: fix boolean expression in pqi_device_remove_start

EXTERNAL EMAIL

Fix boolean expression by using logical AND operator '&&' instead of bitwise operator '&'.

This issue was detected with the help of Coccinelle.

Fixes 1e46731efd9c ("scsi: smartpqi: check for null device pointers")

Thanks for the update.

---
 drivers/scsi/smartpqi/smartpqi_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/smartpqi/smartpqi_init.c +1 -2
index e2fa3f476227..40f58238ce4a 100644
@@ -323,7 +323,7 @@ static inline void pqi_device_remove_start(struct pqi_scsi_dev *device)  static inline bool pqi_device_in_remove(struct pqi_ctrl_info *ctrl_info,
                                        struct pqi_scsi_dev *device)  {
-       return device->in_remove & !ctrl_info->in_shutdown;
+       return device->in_remove && !ctrl_info->in_shutdown;
 }
 
 static inline void pqi_schedule_rescan_worker_with_delay(
--

2.20.1

#2 lore raw
In reply to Gustavo A. R. Silva

Gustavo,

Quoted 2 lines

Fix boolean expression by using logical AND operator '&&' instead of bitwise operator '&'.

Applied to 4.21/scsi-fixes, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering