From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julia Lawall Subject: [PATCH] brcm80211: fix compare_const_fl.cocci warnings Date: Sun, 6 Dec 2015 07:03:26 +0100 (CET) Message-ID: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: kbuild-all@01.org, Brett Rudley , Arend van Spriel , Hante Meuleman , linux-wireless@vger.kernel.org, brcm80211-dev-list@broadcom.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: "Kalle Valo Kalle Valo" Return-path: Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:18103 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750848AbbLFGD2 (ORCPT ); Sun, 6 Dec 2015 01:03:28 -0500 Sender: netdev-owner@vger.kernel.org List-ID: Move constants to the right of binary operators. Generated by: scripts/coccinelle/misc/compare_const_fl.cocci Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- 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; /*