* [PATCH] iwlwifi: fix compare_const_fl.cocci warnings
@ 2015-11-27 16:10 Julia Lawall
2015-11-28 18:46 ` Grumbach, Emmanuel
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2015-11-27 16:10 UTC (permalink / raw)
To: Kalle Valo <kvalo@adurom.com> Kalle Valo
Cc: kbuild-all, Johannes Berg, Emmanuel Grumbach,
Intel Linux Wireless, linux-wireless, 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>
---
This looks a bit nicer around the other way, in my opinion.
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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] iwlwifi: fix compare_const_fl.cocci warnings
2015-11-27 16:10 [PATCH] iwlwifi: fix compare_const_fl.cocci warnings Julia Lawall
@ 2015-11-28 18:46 ` Grumbach, Emmanuel
0 siblings, 0 replies; 2+ messages in thread
From: Grumbach, Emmanuel @ 2015-11-28 18:46 UTC (permalink / raw)
To: Julia Lawall,
Kalle Valo <kvalo-BkwN83ws05HQT0dZR+AlfA@public.gmane.org> Kalle Valo
Cc: kbuild-all-JC7UmRfGjtg@public.gmane.org, Berg, Johannes,
linuxwifi, linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 <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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-28 18:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-27 16:10 [PATCH] iwlwifi: fix compare_const_fl.cocci warnings Julia Lawall
2015-11-28 18:46 ` Grumbach, Emmanuel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox