2020-04-21 03:45:58

by Jason Yan

[permalink] [raw]
Subject: [PATCH] scsi: BusLogic: remove conversion to bool in blogic_inquiry()

The '!=' expression itself is bool, no need to convert it to bool again.
This fixes the following coccicheck warning:

drivers/scsi/BusLogic.c:2240:46-51: WARNING: conversion to bool not
needed here

Signed-off-by: Jason Yan <[email protected]>
---
drivers/scsi/BusLogic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index b5b3154e2c28..bb49d83cadc7 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -2237,7 +2237,7 @@ static bool __init blogic_inquiry(struct blogic_adapter *adapter)
"INQUIRE INSTALLED DEVICES ID 0 TO 7");
for (tgt_id = 0; tgt_id < 8; tgt_id++)
adapter->tgt_flags[tgt_id].tgt_exists =
- (installed_devs0to7[tgt_id] != 0 ? true : false);
+ installed_devs0to7[tgt_id] != 0;
}
/*
Issue the Inquire Setup Information command.
--
2.21.1


2020-04-22 17:43:38

by Khalid Aziz

[permalink] [raw]
Subject: Re: [PATCH] scsi: BusLogic: remove conversion to bool in blogic_inquiry()

On 4/20/20 9:41 PM, Jason Yan wrote:
> The '!=' expression itself is bool, no need to convert it to bool again.
> This fixes the following coccicheck warning:
>
> drivers/scsi/BusLogic.c:2240:46-51: WARNING: conversion to bool not
> needed here
>
> Signed-off-by: Jason Yan <[email protected]>
> ---
> drivers/scsi/BusLogic.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
> index b5b3154e2c28..bb49d83cadc7 100644
> --- a/drivers/scsi/BusLogic.c
> +++ b/drivers/scsi/BusLogic.c
> @@ -2237,7 +2237,7 @@ static bool __init blogic_inquiry(struct blogic_adapter *adapter)
> "INQUIRE INSTALLED DEVICES ID 0 TO 7");
> for (tgt_id = 0; tgt_id < 8; tgt_id++)
> adapter->tgt_flags[tgt_id].tgt_exists =
> - (installed_devs0to7[tgt_id] != 0 ? true : false);
> + installed_devs0to7[tgt_id] != 0;
> }
> /*
> Issue the Inquire Setup Information command.
>

Acked-by: Khalid Aziz <[email protected]>

2020-04-24 17:35:29

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: BusLogic: remove conversion to bool in blogic_inquiry()


Jason,

> The '!=' expression itself is bool, no need to convert it to bool again.
> This fixes the following coccicheck warning:
>
> drivers/scsi/BusLogic.c:2240:46-51: WARNING: conversion to bool not
> needed here

Applied to 5.8/scsi-queue, thanks!

--
Martin K. Petersen Oracle Linux Engineering