All of lore.kernel.org
 help / color / mirror / Atom feed
* [ath9k-devel] [RFC] ath9k_hw: precedence bug in ath9k_hw_set_ofdm_nil()
@ 2012-04-10  9:04 ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2012-04-10  9:04 UTC (permalink / raw)
  To: ath9k-devel

This was introduced in 54da20d83f "ath9k_hw: improve ANI processing and
rx desensitizing parameters".  It triggers a Smatch complaint because
the "if (!x != y) { ..." formation is a common precedence error.

In this case, maybe the code was intended to be as it is.  The
"->ofdmWeakSigDetectOff" and "->ofdm_weak_signal_on" variables are both
boolean.

Or perhaps based we could change the != to an == and remove the negate?

But normally when I see this formation it is a precedence bug so that's
the patch I've sent.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index 47a9fb4..8304e27 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -291,7 +291,7 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel)
 				     entry_ofdm->fir_step_level);
 
 	if ((aniState->noiseFloor >= aniState->rssiThrHigh) &&
-	    (!aniState->ofdmWeakSigDetectOff !=
+	    (aniState->ofdmWeakSigDetectOff !=
 	     entry_ofdm->ofdm_weak_signal_on)) {
 			ath9k_hw_ani_control(ah,
 				ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-04-10 12:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-10  9:04 [ath9k-devel] [RFC] ath9k_hw: precedence bug in ath9k_hw_set_ofdm_nil() Dan Carpenter
2012-04-10  9:04 ` Dan Carpenter
2012-04-10  9:04 ` Dan Carpenter
2012-04-10  9:58 ` [ath9k-devel] " Felix Fietkau
2012-04-10  9:58   ` Felix Fietkau
2012-04-10  9:58   ` Felix Fietkau
2012-04-10 10:57   ` Dan Carpenter
2012-04-10 10:57     ` Dan Carpenter
2012-04-10 10:57     ` Dan Carpenter
2012-04-10 12:50     ` Rajkumar Manoharan
2012-04-10 12:51       ` Rajkumar Manoharan
2012-04-10 12:50       ` Rajkumar Manoharan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.