All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: bnx2fc: fix comparison to bool warning
@ 2020-11-07 16:52 xiakaixu1987
  2020-11-09  4:56 ` Saurav Kashyap
  2020-11-11  4:10 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: xiakaixu1987 @ 2020-11-07 16:52 UTC (permalink / raw)
  To: jejb, martin.petersen; +Cc: linux-scsi, linux-kernel, Kaixu Xia

From: Kaixu Xia <kaixuxia@tencent.com>

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 <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] scsi: bnx2fc: fix comparison to bool warning
  2020-11-07 16:52 [PATCH] scsi: bnx2fc: fix comparison to bool warning xiakaixu1987
@ 2020-11-09  4:56 ` Saurav Kashyap
  2020-11-11  4:10 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Saurav Kashyap @ 2020-11-09  4:56 UTC (permalink / raw)
  To: xiakaixu1987, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel, Kaixu Xia

Hi,


> -----Original Message-----
> From: xiakaixu1987@gmail.com <xiakaixu1987@gmail.com>
> Sent: Saturday, November 7, 2020 10:22 PM
> To: jejb@linux.ibm.com; martin.petersen@oracle.com
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; Kaixu Xia
> <kaixuxia@tencent.com>
> Subject: [PATCH] scsi: bnx2fc: fix comparison to bool warning
> 
> From: Kaixu Xia <kaixuxia@tencent.com>
> 
> 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 <tencent_os_robot@tencent.com>
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
> ---
>  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 <skashyap@marvell.com>

Thanks,
~Saurav
 --
> 2.20.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: bnx2fc: fix comparison to bool warning
  2020-11-07 16:52 [PATCH] scsi: bnx2fc: fix comparison to bool warning xiakaixu1987
  2020-11-09  4:56 ` Saurav Kashyap
@ 2020-11-11  4:10 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2020-11-11  4:10 UTC (permalink / raw)
  To: xiakaixu1987; +Cc: jejb, martin.petersen, linux-scsi, linux-kernel, Kaixu Xia


xiakaixu1987@gmail.com,

> ./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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-11  4:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-07 16:52 [PATCH] scsi: bnx2fc: fix comparison to bool warning xiakaixu1987
2020-11-09  4:56 ` Saurav Kashyap
2020-11-11  4:10 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.