mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Grumbach, Emmanuel" <emmanuel.grumbach@intel.com>
To: Julia Lawall <julia.lawall@lip6.fr>,
	"Kalle Valo <kvalo@adurom.com> Kalle Valo" <kvalo@adurom.com>
Cc: "kbuild-all@01.org" <kbuild-all@01.org>,
	"Berg, Johannes" <johannes.berg@intel.com>,
	linuxwifi <linuxwifi@intel.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] iwlwifi: fix compare_const_fl.cocci warnings
Date: Sat, 28 Nov 2015 18:46:09 +0000	[thread overview]
Message-ID: <0BA3FCBA62E2DC44AF3030971E174FB32E90156E@hasmsx107.ger.corp.intel.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1511271709250.8879@hadrien>

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 <fengguang.wu@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> ---
>
> 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;
>


      reply	other threads:[~2015-11-28 18:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27 16:10 Julia Lawall
2015-11-28 18:46 ` Grumbach, Emmanuel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0BA3FCBA62E2DC44AF3030971E174FB32E90156E@hasmsx107.ger.corp.intel.com \
    --to=emmanuel.grumbach@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kbuild-all@01.org \
    --cc=kvalo@adurom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linuxwifi@intel.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®