2020-11-07 16:56:32

by Kaixu Xia

[permalink] [raw]
Subject: [PATCH] scsi: bnx2fc: fix comparison to bool warning

From: Kaixu Xia <[email protected]>

Fix the following coccicheck warning:

./drivers/scsi/bnx2fc/bnx2fc_fcoe.c:2089:5-23: WARNING: Comparison to bool
./drivers/scsi/bnx2fc/bnx2fc_fcoe.c:2187:5-23: WARNING: Comparison to bool

Reported-by: Tosk Robot <[email protected]>
Signed-off-by: Kaixu Xia <[email protected]>
---
drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 6890bbe04a8c..b612f5ea647e 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -2086,7 +2086,7 @@ static int __bnx2fc_disable(struct fcoe_ctlr *ctlr)
{
struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr);

- if (interface->enabled == true) {
+ if (interface->enabled) {
if (!ctlr->lp) {
pr_err(PFX "__bnx2fc_disable: lport not found\n");
return -ENODEV;
@@ -2184,7 +2184,7 @@ static int __bnx2fc_enable(struct fcoe_ctlr *ctlr)
struct cnic_fc_npiv_tbl *npiv_tbl;
struct fc_lport *lport;

- if (interface->enabled == false) {
+ if (!interface->enabled) {
if (!ctlr->lp) {
pr_err(PFX "__bnx2fc_enable: lport not found\n");
return -ENODEV;
--
2.20.0


2020-11-09 04:59:30

by Saurav Kashyap

[permalink] [raw]
Subject: RE: [PATCH] scsi: bnx2fc: fix comparison to bool warning

Hi,


> -----Original Message-----
> From: [email protected] <[email protected]>
> Sent: Saturday, November 7, 2020 10:22 PM
> To: [email protected]; [email protected]
> Cc: [email protected]; [email protected]; Kaixu Xia
> <[email protected]>
> Subject: [PATCH] scsi: bnx2fc: fix comparison to bool warning
>
> From: Kaixu Xia <[email protected]>
>
> Fix the following coccicheck warning:
>
> ./drivers/scsi/bnx2fc/bnx2fc_fcoe.c:2089:5-23: WARNING: Comparison to bool
> ./drivers/scsi/bnx2fc/bnx2fc_fcoe.c:2187:5-23: WARNING: Comparison to bool
>
> Reported-by: Tosk Robot <[email protected]>
> Signed-off-by: Kaixu Xia <[email protected]>
> ---
> drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
> b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
> index 6890bbe04a8c..b612f5ea647e 100644
> --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
> +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
> @@ -2086,7 +2086,7 @@ static int __bnx2fc_disable(struct fcoe_ctlr *ctlr)
> {
> struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr);
>
> - if (interface->enabled == true) {
> + if (interface->enabled) {
> if (!ctlr->lp) {
> pr_err(PFX "__bnx2fc_disable: lport not found\n");
> return -ENODEV;
> @@ -2184,7 +2184,7 @@ static int __bnx2fc_enable(struct fcoe_ctlr *ctlr)
> struct cnic_fc_npiv_tbl *npiv_tbl;
> struct fc_lport *lport;
>
> - if (interface->enabled == false) {
> + if (!interface->enabled) {
> if (!ctlr->lp) {
> pr_err(PFX "__bnx2fc_enable: lport not found\n");
> return -ENODEV;
>
Thanks for a patch.

Acked-by: Saurav Kashyap <[email protected]>

Thanks,
~Saurav
--
> 2.20.0


2020-11-11 04:15:43

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: bnx2fc: fix comparison to bool warning


[email protected],

> ./drivers/scsi/bnx2fc/bnx2fc_fcoe.c:2089:5-23: WARNING: Comparison to bool
> ./drivers/scsi/bnx2fc/bnx2fc_fcoe.c:2187:5-23: WARNING: Comparison to bool

Applied to 5.11/scsi-staging, thanks!

--
Martin K. Petersen Oracle Linux Engineering