linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ray_cs: use true,false for bool variable
@ 2020-04-26 10:37 Jason Yan
  2020-05-06  8:33 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Yan @ 2020-04-26 10:37 UTC (permalink / raw)
  To: kvalo, davem, adobriyan, tglx, linux-wireless, netdev,
	linux-kernel, sergei.shtylyov
  Cc: Jason Yan

Fix the following coccicheck warning:

drivers/net/wireless/ray_cs.c:2797:5-14: WARNING: Comparison of 0/1 to
bool variable
drivers/net/wireless/ray_cs.c:2798:2-11: WARNING: Assignment of 0/1 to
bool variable

Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 v2: Fix wrong logic of v1 which made 'translate != 0' to '!translate'.

 drivers/net/wireless/ray_cs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index c1d542bfa530..bf3fbd14eda3 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -2794,8 +2794,7 @@ static int __init init_ray_cs(void)
 	proc_create_data("driver/ray_cs/translate", 0200, NULL, &int_proc_ops,
 			 &translate);
 #endif
-	if (translate != 0)
-		translate = 1;
+	translate = !!translate;
 	return 0;
 } /* init_ray_cs */
 
-- 
2.21.1


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

* Re: [PATCH v2] ray_cs: use true,false for bool variable
  2020-04-26 10:37 [PATCH v2] ray_cs: use true,false for bool variable Jason Yan
@ 2020-05-06  8:33 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2020-05-06  8:33 UTC (permalink / raw)
  To: Jason Yan
  Cc: davem, adobriyan, tglx, linux-wireless, netdev, linux-kernel,
	sergei.shtylyov, Jason Yan

Jason Yan <yanaijie@huawei.com> wrote:

> Fix the following coccicheck warning:
> 
> drivers/net/wireless/ray_cs.c:2797:5-14: WARNING: Comparison of 0/1 to
> bool variable
> drivers/net/wireless/ray_cs.c:2798:2-11: WARNING: Assignment of 0/1 to
> bool variable
> 
> Signed-off-by: Jason Yan <yanaijie@huawei.com>

Patch applied to wireless-drivers-next.git, thanks.

1f15d7c8f3fc ray_cs: use true,false for bool variable

-- 
https://patchwork.kernel.org/patch/11510389/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

end of thread, other threads:[~2020-05-06  8:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-26 10:37 [PATCH v2] ray_cs: use true,false for bool variable Jason Yan
2020-05-06  8:33 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).