Skip to content

Commit 1b56452

Browse files
eworm-demcb30
authored andcommittedApr 24, 2015
[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>
1 parent bf40b79 commit 1b56452

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed
 

‎src/drivers/net/ath/ath9k/ani.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct ar5416AniState {
125125
u8 mrcCCKOff;
126126
u8 spurImmunityLevel;
127127
u8 firstepLevel;
128-
u8 ofdmWeakSigDetectOff;
128+
u8 ofdmWeakSigDetect;
129129
u8 cckWeakSigThreshold;
130130
u32 listenTime;
131131
int32_t rssiThrLow;

‎src/drivers/net/ath/ath9k/ath9k_ani.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static void ath9k_hw_ani_ofdm_err_trigger_old(struct ath_hw *ah)
177177

178178
rssi = BEACON_RSSI(ah);
179179
if (rssi > aniState->rssiThrHigh) {
180-
if (!aniState->ofdmWeakSigDetectOff) {
180+
if (aniState->ofdmWeakSigDetect) {
181181
if (ath9k_hw_ani_control(ah,
182182
ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
183183
0)) {
@@ -192,7 +192,7 @@ static void ath9k_hw_ani_ofdm_err_trigger_old(struct ath_hw *ah)
192192
return;
193193
}
194194
} else if (rssi > aniState->rssiThrLow) {
195-
if (aniState->ofdmWeakSigDetectOff)
195+
if (!aniState->ofdmWeakSigDetect)
196196
ath9k_hw_ani_control(ah,
197197
ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
198198
1);
@@ -202,7 +202,7 @@ static void ath9k_hw_ani_ofdm_err_trigger_old(struct ath_hw *ah)
202202
return;
203203
} else {
204204
if ((ah->dev->channels + ah->dev->channel)->band == NET80211_BAND_2GHZ) {
205-
if (!aniState->ofdmWeakSigDetectOff)
205+
if (aniState->ofdmWeakSigDetect)
206206
ath9k_hw_ani_control(ah,
207207
ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
208208
0);
@@ -360,7 +360,7 @@ static void ath9k_hw_ani_lower_immunity_old(struct ath_hw *ah)
360360
if (rssi > aniState->rssiThrHigh) {
361361
/* XXX: Handle me */
362362
} else if (rssi > aniState->rssiThrLow) {
363-
if (aniState->ofdmWeakSigDetectOff) {
363+
if (!aniState->ofdmWeakSigDetect) {
364364
if (ath9k_hw_ani_control(ah,
365365
ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
366366
1) == 1)
@@ -436,9 +436,9 @@ static void ath9k_ani_reset_old(struct ath_hw *ah)
436436
if (aniState->spurImmunityLevel != 0)
437437
ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL,
438438
aniState->spurImmunityLevel);
439-
if (aniState->ofdmWeakSigDetectOff)
439+
if (!aniState->ofdmWeakSigDetect)
440440
ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
441-
!aniState->ofdmWeakSigDetectOff);
441+
aniState->ofdmWeakSigDetect);
442442
if (aniState->cckWeakSigThreshold)
443443
ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR,
444444
aniState->cckWeakSigThreshold);
@@ -709,8 +709,8 @@ void ath9k_hw_ani_init(struct ath_hw *ah)
709709

710710
ani->rssiThrHigh = ATH9K_ANI_RSSI_THR_HIGH;
711711
ani->rssiThrLow = ATH9K_ANI_RSSI_THR_LOW;
712-
ani->ofdmWeakSigDetectOff =
713-
!ATH9K_ANI_USE_OFDM_WEAK_SIG;
712+
ani->ofdmWeakSigDetect =
713+
ATH9K_ANI_USE_OFDM_WEAK_SIG;
714714
ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL;
715715
}
716716

‎src/drivers/net/ath/ath9k/ath9k_ar5008_phy.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,12 +1141,12 @@ static int ar5008_hw_ani_control_old(struct ath_hw *ah,
11411141
REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW,
11421142
AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW);
11431143

1144-
if (!on != aniState->ofdmWeakSigDetectOff) {
1144+
if (on != aniState->ofdmWeakSigDetect) {
11451145
if (on)
11461146
ah->stats.ast_ani_ofdmon++;
11471147
else
11481148
ah->stats.ast_ani_ofdmoff++;
1149-
aniState->ofdmWeakSigDetectOff = !on;
1149+
aniState->ofdmWeakSigDetect = on;
11501150
}
11511151
break;
11521152
}
@@ -1215,10 +1215,10 @@ static int ar5008_hw_ani_control_old(struct ath_hw *ah,
12151215

12161216
DBG2("ath9k: ANI parameters:\n");
12171217
DBG2(
1218-
"noiseImmunityLevel=%d, spurImmunityLevel=%d, ofdmWeakSigDetectOff=%d\n",
1218+
"noiseImmunityLevel=%d, spurImmunityLevel=%d, ofdmWeakSigDetect=%d\n",
12191219
aniState->noiseImmunityLevel,
12201220
aniState->spurImmunityLevel,
1221-
!aniState->ofdmWeakSigDetectOff);
1221+
aniState->ofdmWeakSigDetect);
12221222
DBG2(
12231223
"cckWeakSigThreshold=%d, firstepLevel=%d, listenTime=%d\n",
12241224
aniState->cckWeakSigThreshold,
@@ -1307,18 +1307,18 @@ static int ar5008_hw_ani_control_new(struct ath_hw *ah,
13071307
REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW,
13081308
AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW);
13091309

1310-
if (!on != aniState->ofdmWeakSigDetectOff) {
1310+
if (on != aniState->ofdmWeakSigDetect) {
13111311
DBG2("ath9k: "
13121312
"** ch %d: ofdm weak signal: %s=>%s\n",
13131313
chan->channel,
1314-
!aniState->ofdmWeakSigDetectOff ?
1314+
aniState->ofdmWeakSigDetect ?
13151315
"on" : "off",
13161316
on ? "on" : "off");
13171317
if (on)
13181318
ah->stats.ast_ani_ofdmon++;
13191319
else
13201320
ah->stats.ast_ani_ofdmoff++;
1321-
aniState->ofdmWeakSigDetectOff = !on;
1321+
aniState->ofdmWeakSigDetect = on;
13221322
}
13231323
break;
13241324
}
@@ -1467,7 +1467,7 @@ static int ar5008_hw_ani_control_new(struct ath_hw *ah,
14671467
DBG2("ath9k: "
14681468
"ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n",
14691469
aniState->spurImmunityLevel,
1470-
!aniState->ofdmWeakSigDetectOff ? "on" : "off",
1470+
aniState->ofdmWeakSigDetect ? "on" : "off",
14711471
aniState->firstepLevel,
14721472
!aniState->mrcCCKOff ? "on" : "off",
14731473
aniState->listenTime,
@@ -1554,7 +1554,7 @@ static void ar5008_hw_ani_cache_ini_regs(struct ath_hw *ah)
15541554
/* these levels just got reset to defaults by the INI */
15551555
aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW;
15561556
aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW;
1557-
aniState->ofdmWeakSigDetectOff = !ATH9K_ANI_USE_OFDM_WEAK_SIG;
1557+
aniState->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG;
15581558
aniState->mrcCCKOff = 1; /* not available on pre AR9003 */
15591559
}
15601560

‎src/drivers/net/ath/ath9k/ath9k_ar9003_phy.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -859,18 +859,18 @@ static int ar9003_hw_ani_control(struct ath_hw *ah,
859859
REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW,
860860
AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW);
861861

862-
if (!on != aniState->ofdmWeakSigDetectOff) {
862+
if (on != aniState->ofdmWeakSigDetect) {
863863
DBG2("ath9k: "
864864
"** ch %d: ofdm weak signal: %s=>%s\n",
865865
chan->channel,
866-
!aniState->ofdmWeakSigDetectOff ?
866+
aniState->ofdmWeakSigDetect ?
867867
"on" : "off",
868868
on ? "on" : "off");
869869
if (on)
870870
ah->stats.ast_ani_ofdmon++;
871871
else
872872
ah->stats.ast_ani_ofdmoff++;
873-
aniState->ofdmWeakSigDetectOff = !on;
873+
aniState->ofdmWeakSigDetect = on;
874874
}
875875
break;
876876
}
@@ -1013,7 +1013,7 @@ static int ar9003_hw_ani_control(struct ath_hw *ah,
10131013
AR_PHY_MRC_CCK_ENABLE, is_on);
10141014
REG_RMW_FIELD(ah, AR_PHY_MRC_CCK_CTRL,
10151015
AR_PHY_MRC_CCK_MUX_REG, is_on);
1016-
if (!is_on != aniState->mrcCCKOff) {
1016+
if (!(is_on != aniState->mrcCCKOff)) {
10171017
DBG2("ath9k: "
10181018
"** ch %d: MRC CCK: %s=>%s\n",
10191019
chan->channel,
@@ -1037,7 +1037,7 @@ static int ar9003_hw_ani_control(struct ath_hw *ah,
10371037
DBG2("ath9k: "
10381038
"ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n",
10391039
aniState->spurImmunityLevel,
1040-
!aniState->ofdmWeakSigDetectOff ? "on" : "off",
1040+
aniState->ofdmWeakSigDetect ? "on" : "off",
10411041
aniState->firstepLevel,
10421042
!aniState->mrcCCKOff ? "on" : "off",
10431043
aniState->listenTime,
@@ -1137,7 +1137,7 @@ static void ar9003_hw_ani_cache_ini_regs(struct ath_hw *ah)
11371137
/* these levels just got reset to defaults by the INI */
11381138
aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW;
11391139
aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW;
1140-
aniState->ofdmWeakSigDetectOff = !ATH9K_ANI_USE_OFDM_WEAK_SIG;
1140+
aniState->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG;
11411141
aniState->mrcCCKOff = !ATH9K_ANI_ENABLE_MRC_CCK;
11421142
}
11431143

0 commit comments

Comments
 (0)