From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752732AbbK1SqQ (ORCPT ); Sat, 28 Nov 2015 13:46:16 -0500 Received: from mga11.intel.com ([192.55.52.93]:21934 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752489AbbK1SqO convert rfc822-to-8bit (ORCPT ); Sat, 28 Nov 2015 13:46:14 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,357,1444719600"; d="scan'208";a="849331140" From: "Grumbach, Emmanuel" To: Julia Lawall , "Kalle Valo Kalle Valo" CC: "kbuild-all@01.org" , "Berg, Johannes" , linuxwifi , "linux-wireless@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] iwlwifi: fix compare_const_fl.cocci warnings Thread-Topic: [PATCH] iwlwifi: fix compare_const_fl.cocci warnings Thread-Index: AQHRKS5CUUOXAqonnkqP4CdANOPCIA== Date: Sat, 28 Nov 2015 18:46:09 +0000 Message-ID: <0BA3FCBA62E2DC44AF3030971E174FB32E90156E@hasmsx107.ger.corp.intel.com> References: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.255.197.252] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Julia, On 11/27/2015 06:11 PM, Julia Lawall wrote: > 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 > --- > > This looks a bit nicer around the other way, in my opinion. Thanks, I picked it up. I agree with your taste although having constants on the left side can avoid the typo = instead of == since they can't be an l-value. Obviously we never do that and prefer to have the constant on the right side. More readable for sure. > > calib.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/drivers/net/wireless/intel/iwlwifi/dvm/calib.c > +++ b/drivers/net/wireless/intel/iwlwifi/dvm/calib.c > @@ -311,7 +311,7 @@ static int iwl_sens_energy_cck(struct iw > /* If previous beacon had too many false alarms, > * give it some extra margin by reducing sensitivity again > * (but don't go below measured energy of desired Rx) */ > - if (IWL_FA_TOO_MANY == data->nrg_prev_state) { > + if (data->nrg_prev_state == IWL_FA_TOO_MANY) { > IWL_DEBUG_CALIB(priv, "... increasing margin\n"); > if (data->nrg_th_cck > (max_nrg_cck + NRG_MARGIN)) > data->nrg_th_cck -= NRG_MARGIN; >