[ath9k] Remove confusing logic inversion in an ANI variable

This changed in Linux kernel the same way in commit 7067e701
("ath9k_hw: remove confusing logic inversion in an ANI variable") by
Felix Fietkau.

Additionally this fixes "error: logical not is only applied to the
left hand side of comparison" with GCC 5.1.0.

Signed-off-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
pull/36/head
Christian Hesse 2015-04-23 13:33:26 +02:00 committed by Michael Brown
parent bf40b79734
commit 1b56452121
4 changed files with 24 additions and 24 deletions

View File

@ -125,7 +125,7 @@ struct ar5416AniState {
u8 mrcCCKOff; u8 mrcCCKOff;
u8 spurImmunityLevel; u8 spurImmunityLevel;
u8 firstepLevel; u8 firstepLevel;
u8 ofdmWeakSigDetectOff; u8 ofdmWeakSigDetect;
u8 cckWeakSigThreshold; u8 cckWeakSigThreshold;
u32 listenTime; u32 listenTime;
int32_t rssiThrLow; int32_t rssiThrLow;

View File

@ -177,7 +177,7 @@ static void ath9k_hw_ani_ofdm_err_trigger_old(struct ath_hw *ah)
rssi = BEACON_RSSI(ah); rssi = BEACON_RSSI(ah);
if (rssi > aniState->rssiThrHigh) { if (rssi > aniState->rssiThrHigh) {
if (!aniState->ofdmWeakSigDetectOff) { if (aniState->ofdmWeakSigDetect) {
if (ath9k_hw_ani_control(ah, if (ath9k_hw_ani_control(ah,
ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
0)) { 0)) {
@ -192,7 +192,7 @@ static void ath9k_hw_ani_ofdm_err_trigger_old(struct ath_hw *ah)
return; return;
} }
} else if (rssi > aniState->rssiThrLow) { } else if (rssi > aniState->rssiThrLow) {
if (aniState->ofdmWeakSigDetectOff) if (!aniState->ofdmWeakSigDetect)
ath9k_hw_ani_control(ah, ath9k_hw_ani_control(ah,
ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
1); 1);
@ -202,7 +202,7 @@ static void ath9k_hw_ani_ofdm_err_trigger_old(struct ath_hw *ah)
return; return;
} else { } else {
if ((ah->dev->channels + ah->dev->channel)->band == NET80211_BAND_2GHZ) { if ((ah->dev->channels + ah->dev->channel)->band == NET80211_BAND_2GHZ) {
if (!aniState->ofdmWeakSigDetectOff) if (aniState->ofdmWeakSigDetect)
ath9k_hw_ani_control(ah, ath9k_hw_ani_control(ah,
ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
0); 0);
@ -360,7 +360,7 @@ static void ath9k_hw_ani_lower_immunity_old(struct ath_hw *ah)
if (rssi > aniState->rssiThrHigh) { if (rssi > aniState->rssiThrHigh) {
/* XXX: Handle me */ /* XXX: Handle me */
} else if (rssi > aniState->rssiThrLow) { } else if (rssi > aniState->rssiThrLow) {
if (aniState->ofdmWeakSigDetectOff) { if (!aniState->ofdmWeakSigDetect) {
if (ath9k_hw_ani_control(ah, if (ath9k_hw_ani_control(ah,
ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
1) == 1) 1) == 1)
@ -436,9 +436,9 @@ static void ath9k_ani_reset_old(struct ath_hw *ah)
if (aniState->spurImmunityLevel != 0) if (aniState->spurImmunityLevel != 0)
ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL,
aniState->spurImmunityLevel); aniState->spurImmunityLevel);
if (aniState->ofdmWeakSigDetectOff) if (!aniState->ofdmWeakSigDetect)
ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
!aniState->ofdmWeakSigDetectOff); aniState->ofdmWeakSigDetect);
if (aniState->cckWeakSigThreshold) if (aniState->cckWeakSigThreshold)
ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR, ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR,
aniState->cckWeakSigThreshold); aniState->cckWeakSigThreshold);
@ -709,8 +709,8 @@ void ath9k_hw_ani_init(struct ath_hw *ah)
ani->rssiThrHigh = ATH9K_ANI_RSSI_THR_HIGH; ani->rssiThrHigh = ATH9K_ANI_RSSI_THR_HIGH;
ani->rssiThrLow = ATH9K_ANI_RSSI_THR_LOW; ani->rssiThrLow = ATH9K_ANI_RSSI_THR_LOW;
ani->ofdmWeakSigDetectOff = ani->ofdmWeakSigDetect =
!ATH9K_ANI_USE_OFDM_WEAK_SIG; ATH9K_ANI_USE_OFDM_WEAK_SIG;
ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL; ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL;
} }

View File

@ -1141,12 +1141,12 @@ static int ar5008_hw_ani_control_old(struct ath_hw *ah,
REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW,
AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW);
if (!on != aniState->ofdmWeakSigDetectOff) { if (on != aniState->ofdmWeakSigDetect) {
if (on) if (on)
ah->stats.ast_ani_ofdmon++; ah->stats.ast_ani_ofdmon++;
else else
ah->stats.ast_ani_ofdmoff++; ah->stats.ast_ani_ofdmoff++;
aniState->ofdmWeakSigDetectOff = !on; aniState->ofdmWeakSigDetect = on;
} }
break; break;
} }
@ -1215,10 +1215,10 @@ static int ar5008_hw_ani_control_old(struct ath_hw *ah,
DBG2("ath9k: ANI parameters:\n"); DBG2("ath9k: ANI parameters:\n");
DBG2( DBG2(
"noiseImmunityLevel=%d, spurImmunityLevel=%d, ofdmWeakSigDetectOff=%d\n", "noiseImmunityLevel=%d, spurImmunityLevel=%d, ofdmWeakSigDetect=%d\n",
aniState->noiseImmunityLevel, aniState->noiseImmunityLevel,
aniState->spurImmunityLevel, aniState->spurImmunityLevel,
!aniState->ofdmWeakSigDetectOff); aniState->ofdmWeakSigDetect);
DBG2( DBG2(
"cckWeakSigThreshold=%d, firstepLevel=%d, listenTime=%d\n", "cckWeakSigThreshold=%d, firstepLevel=%d, listenTime=%d\n",
aniState->cckWeakSigThreshold, aniState->cckWeakSigThreshold,
@ -1307,18 +1307,18 @@ static int ar5008_hw_ani_control_new(struct ath_hw *ah,
REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW,
AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW);
if (!on != aniState->ofdmWeakSigDetectOff) { if (on != aniState->ofdmWeakSigDetect) {
DBG2("ath9k: " DBG2("ath9k: "
"** ch %d: ofdm weak signal: %s=>%s\n", "** ch %d: ofdm weak signal: %s=>%s\n",
chan->channel, chan->channel,
!aniState->ofdmWeakSigDetectOff ? aniState->ofdmWeakSigDetect ?
"on" : "off", "on" : "off",
on ? "on" : "off"); on ? "on" : "off");
if (on) if (on)
ah->stats.ast_ani_ofdmon++; ah->stats.ast_ani_ofdmon++;
else else
ah->stats.ast_ani_ofdmoff++; ah->stats.ast_ani_ofdmoff++;
aniState->ofdmWeakSigDetectOff = !on; aniState->ofdmWeakSigDetect = on;
} }
break; break;
} }
@ -1467,7 +1467,7 @@ static int ar5008_hw_ani_control_new(struct ath_hw *ah,
DBG2("ath9k: " DBG2("ath9k: "
"ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n", "ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n",
aniState->spurImmunityLevel, aniState->spurImmunityLevel,
!aniState->ofdmWeakSigDetectOff ? "on" : "off", aniState->ofdmWeakSigDetect ? "on" : "off",
aniState->firstepLevel, aniState->firstepLevel,
!aniState->mrcCCKOff ? "on" : "off", !aniState->mrcCCKOff ? "on" : "off",
aniState->listenTime, aniState->listenTime,
@ -1554,7 +1554,7 @@ static void ar5008_hw_ani_cache_ini_regs(struct ath_hw *ah)
/* these levels just got reset to defaults by the INI */ /* these levels just got reset to defaults by the INI */
aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW;
aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW;
aniState->ofdmWeakSigDetectOff = !ATH9K_ANI_USE_OFDM_WEAK_SIG; aniState->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG;
aniState->mrcCCKOff = 1; /* not available on pre AR9003 */ aniState->mrcCCKOff = 1; /* not available on pre AR9003 */
} }

View File

@ -859,18 +859,18 @@ static int ar9003_hw_ani_control(struct ath_hw *ah,
REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW,
AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW);
if (!on != aniState->ofdmWeakSigDetectOff) { if (on != aniState->ofdmWeakSigDetect) {
DBG2("ath9k: " DBG2("ath9k: "
"** ch %d: ofdm weak signal: %s=>%s\n", "** ch %d: ofdm weak signal: %s=>%s\n",
chan->channel, chan->channel,
!aniState->ofdmWeakSigDetectOff ? aniState->ofdmWeakSigDetect ?
"on" : "off", "on" : "off",
on ? "on" : "off"); on ? "on" : "off");
if (on) if (on)
ah->stats.ast_ani_ofdmon++; ah->stats.ast_ani_ofdmon++;
else else
ah->stats.ast_ani_ofdmoff++; ah->stats.ast_ani_ofdmoff++;
aniState->ofdmWeakSigDetectOff = !on; aniState->ofdmWeakSigDetect = on;
} }
break; break;
} }
@ -1013,7 +1013,7 @@ static int ar9003_hw_ani_control(struct ath_hw *ah,
AR_PHY_MRC_CCK_ENABLE, is_on); AR_PHY_MRC_CCK_ENABLE, is_on);
REG_RMW_FIELD(ah, AR_PHY_MRC_CCK_CTRL, REG_RMW_FIELD(ah, AR_PHY_MRC_CCK_CTRL,
AR_PHY_MRC_CCK_MUX_REG, is_on); AR_PHY_MRC_CCK_MUX_REG, is_on);
if (!is_on != aniState->mrcCCKOff) { if (!(is_on != aniState->mrcCCKOff)) {
DBG2("ath9k: " DBG2("ath9k: "
"** ch %d: MRC CCK: %s=>%s\n", "** ch %d: MRC CCK: %s=>%s\n",
chan->channel, chan->channel,
@ -1037,7 +1037,7 @@ static int ar9003_hw_ani_control(struct ath_hw *ah,
DBG2("ath9k: " DBG2("ath9k: "
"ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n", "ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n",
aniState->spurImmunityLevel, aniState->spurImmunityLevel,
!aniState->ofdmWeakSigDetectOff ? "on" : "off", aniState->ofdmWeakSigDetect ? "on" : "off",
aniState->firstepLevel, aniState->firstepLevel,
!aniState->mrcCCKOff ? "on" : "off", !aniState->mrcCCKOff ? "on" : "off",
aniState->listenTime, aniState->listenTime,
@ -1137,7 +1137,7 @@ static void ar9003_hw_ani_cache_ini_regs(struct ath_hw *ah)
/* these levels just got reset to defaults by the INI */ /* these levels just got reset to defaults by the INI */
aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW;
aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW;
aniState->ofdmWeakSigDetectOff = !ATH9K_ANI_USE_OFDM_WEAK_SIG; aniState->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG;
aniState->mrcCCKOff = !ATH9K_ANI_ENABLE_MRC_CCK; aniState->mrcCCKOff = !ATH9K_ANI_ENABLE_MRC_CCK;
} }