netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] brcm80211: fix compare_const_fl.cocci warnings
@ 2015-12-06  6:03 Julia Lawall
  2015-12-11 11:26 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2015-12-06  6:03 UTC (permalink / raw)
  To: Kalle Valo <kvalo@adurom.com> Kalle Valo
  Cc: kbuild-all, Brett Rudley, Arend van Spriel, Hante Meuleman,
	linux-wireless, brcm80211-dev-list, netdev, linux-kernel

Move constants to the right of binary operators.

Generated by: scripts/coccinelle/misc/compare_const_fl.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

Minor point.  But in my opinion, it would look a little nicer to have the 
thing acted on (code[...]) come first.

 channel.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/channel.c
@@ -177,8 +177,8 @@ static bool brcms_c_country_valid(const
 	 * only allow ascii alpha uppercase for the first 2
 	 * chars.
 	 */
-	if (!((0x80 & ccode[0]) == 0 && ccode[0] >= 0x41 && ccode[0] <= 0x5A &&
-	      (0x80 & ccode[1]) == 0 && ccode[1] >= 0x41 && ccode[1] <= 0x5A))
+	if (!((ccode[0] & 0x80) == 0 && ccode[0] >= 0x41 && ccode[0] <= 0x5A &&
+	      (ccode[1] & 0x80) == 0 && ccode[1] >= 0x41 && ccode[1] <= 0x5A))
 		return false;
 
 	/*

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

end of thread, other threads:[~2015-12-11 11:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-06  6:03 [PATCH] brcm80211: fix compare_const_fl.cocci warnings Julia Lawall
2015-12-11 11:26 ` 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).