From: "Grumbach, Emmanuel" <emmanuel.grumbach-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Julia Lawall <julia.lawall-L2FTfq7BK8M@public.gmane.org>,
"Kalle Valo <kvalo-BkwN83ws05HQT0dZR+AlfA@public.gmane.org>
Kalle Valo" <kvalo-BkwN83ws05HQT0dZR+AlfA@public.gmane.org>
Cc: "kbuild-all-JC7UmRfGjtg@public.gmane.org"
<kbuild-all-JC7UmRfGjtg@public.gmane.org>,
"Berg,
Johannes" <johannes.berg-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
linuxwifi <linuxwifi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
"linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Julia Lawall <julia.lawall-L2FTfq7BK8M@public.gmane.org>
> ---
>
> 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;
>
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent 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 [PATCH] iwlwifi: fix compare_const_fl.cocci warnings 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-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=johannes.berg-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=julia.lawall-L2FTfq7BK8M@public.gmane.org \
--cc=kbuild-all-JC7UmRfGjtg@public.gmane.org \
--cc=kvalo-BkwN83ws05HQT0dZR+AlfA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linuxwifi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.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