scsi: smartpqi_init: fix boolean expression in pqi_device_remove_start
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Thu, 3 Jan 2019 16:47:44 +0000 (10:47 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 9 Jan 2019 02:57:26 +0000 (21:57 -0500)
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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/smartpqi/smartpqi_init.c

index e2fa3f4..40f5823 100644 (file)
@@ -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(