Browse Source

[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>
tags/v1.20.1
Christian Hesse 9 years ago
parent
commit
1b56452121

+ 1
- 1
src/drivers/net/ath/ath9k/ani.h View File

@@ -125,7 +125,7 @@ struct ar5416AniState {
125 125
 	u8 mrcCCKOff;
126 126
 	u8 spurImmunityLevel;
127 127
 	u8 firstepLevel;
128
-	u8 ofdmWeakSigDetectOff;
128
+	u8 ofdmWeakSigDetect;
129 129
 	u8 cckWeakSigThreshold;
130 130
 	u32 listenTime;
131 131
 	int32_t rssiThrLow;

+ 8
- 8
src/drivers/net/ath/ath9k/ath9k_ani.c View File

@@ -177,7 +177,7 @@ static void ath9k_hw_ani_ofdm_err_trigger_old(struct ath_hw *ah)
177 177
 
178 178
 	rssi = BEACON_RSSI(ah);
179 179
 	if (rssi > aniState->rssiThrHigh) {
180
-		if (!aniState->ofdmWeakSigDetectOff) {
180
+		if (aniState->ofdmWeakSigDetect) {
181 181
 			if (ath9k_hw_ani_control(ah,
182 182
 					 ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
183 183
 					 0)) {
@@ -192,7 +192,7 @@ static void ath9k_hw_ani_ofdm_err_trigger_old(struct ath_hw *ah)
192 192
 			return;
193 193
 		}
194 194
 	} else if (rssi > aniState->rssiThrLow) {
195
-		if (aniState->ofdmWeakSigDetectOff)
195
+		if (!aniState->ofdmWeakSigDetect)
196 196
 			ath9k_hw_ani_control(ah,
197 197
 				     ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
198 198
 				     1);
@@ -202,7 +202,7 @@ static void ath9k_hw_ani_ofdm_err_trigger_old(struct ath_hw *ah)
202 202
 		return;
203 203
 	} else {
204 204
 		if ((ah->dev->channels + ah->dev->channel)->band == NET80211_BAND_2GHZ) {
205
-			if (!aniState->ofdmWeakSigDetectOff)
205
+			if (aniState->ofdmWeakSigDetect)
206 206
 				ath9k_hw_ani_control(ah,
207 207
 				     ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
208 208
 				     0);
@@ -360,7 +360,7 @@ static void ath9k_hw_ani_lower_immunity_old(struct ath_hw *ah)
360 360
 	if (rssi > aniState->rssiThrHigh) {
361 361
 		/* XXX: Handle me */
362 362
 	} else if (rssi > aniState->rssiThrLow) {
363
-		if (aniState->ofdmWeakSigDetectOff) {
363
+		if (!aniState->ofdmWeakSigDetect) {
364 364
 			if (ath9k_hw_ani_control(ah,
365 365
 				 ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
366 366
 				 1) == 1)
@@ -436,9 +436,9 @@ static void ath9k_ani_reset_old(struct ath_hw *ah)
436 436
 	if (aniState->spurImmunityLevel != 0)
437 437
 		ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL,
438 438
 				     aniState->spurImmunityLevel);
439
-	if (aniState->ofdmWeakSigDetectOff)
439
+	if (!aniState->ofdmWeakSigDetect)
440 440
 		ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
441
-				     !aniState->ofdmWeakSigDetectOff);
441
+				     aniState->ofdmWeakSigDetect);
442 442
 	if (aniState->cckWeakSigThreshold)
443 443
 		ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR,
444 444
 				     aniState->cckWeakSigThreshold);
@@ -709,8 +709,8 @@ void ath9k_hw_ani_init(struct ath_hw *ah)
709 709
 
710 710
 		ani->rssiThrHigh = ATH9K_ANI_RSSI_THR_HIGH;
711 711
 		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;
714 714
 		ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL;
715 715
 	}
716 716
 

+ 9
- 9
src/drivers/net/ath/ath9k/ath9k_ar5008_phy.c View File

@@ -1141,12 +1141,12 @@ static int ar5008_hw_ani_control_old(struct ath_hw *ah,
1141 1141
 			REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW,
1142 1142
 				    AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW);
1143 1143
 
1144
-		if (!on != aniState->ofdmWeakSigDetectOff) {
1144
+		if (on != aniState->ofdmWeakSigDetect) {
1145 1145
 			if (on)
1146 1146
 				ah->stats.ast_ani_ofdmon++;
1147 1147
 			else
1148 1148
 				ah->stats.ast_ani_ofdmoff++;
1149
-			aniState->ofdmWeakSigDetectOff = !on;
1149
+			aniState->ofdmWeakSigDetect = on;
1150 1150
 		}
1151 1151
 		break;
1152 1152
 	}
@@ -1215,10 +1215,10 @@ static int ar5008_hw_ani_control_old(struct ath_hw *ah,
1215 1215
 
1216 1216
 	DBG2("ath9k: ANI parameters:\n");
1217 1217
 	DBG2(
1218
-		"noiseImmunityLevel=%d, spurImmunityLevel=%d, ofdmWeakSigDetectOff=%d\n",
1218
+		"noiseImmunityLevel=%d, spurImmunityLevel=%d, ofdmWeakSigDetect=%d\n",
1219 1219
 		aniState->noiseImmunityLevel,
1220 1220
 		aniState->spurImmunityLevel,
1221
-		!aniState->ofdmWeakSigDetectOff);
1221
+		aniState->ofdmWeakSigDetect);
1222 1222
 	DBG2(
1223 1223
 		"cckWeakSigThreshold=%d, firstepLevel=%d, listenTime=%d\n",
1224 1224
 		aniState->cckWeakSigThreshold,
@@ -1307,18 +1307,18 @@ static int ar5008_hw_ani_control_new(struct ath_hw *ah,
1307 1307
 			REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW,
1308 1308
 				    AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW);
1309 1309
 
1310
-		if (!on != aniState->ofdmWeakSigDetectOff) {
1310
+		if (on != aniState->ofdmWeakSigDetect) {
1311 1311
 			DBG2("ath9k: "
1312 1312
 				"** ch %d: ofdm weak signal: %s=>%s\n",
1313 1313
 				chan->channel,
1314
-				!aniState->ofdmWeakSigDetectOff ?
1314
+				aniState->ofdmWeakSigDetect ?
1315 1315
 				"on" : "off",
1316 1316
 				on ? "on" : "off");
1317 1317
 			if (on)
1318 1318
 				ah->stats.ast_ani_ofdmon++;
1319 1319
 			else
1320 1320
 				ah->stats.ast_ani_ofdmoff++;
1321
-			aniState->ofdmWeakSigDetectOff = !on;
1321
+			aniState->ofdmWeakSigDetect = on;
1322 1322
 		}
1323 1323
 		break;
1324 1324
 	}
@@ -1467,7 +1467,7 @@ static int ar5008_hw_ani_control_new(struct ath_hw *ah,
1467 1467
 	DBG2("ath9k: "
1468 1468
 		"ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n",
1469 1469
 		aniState->spurImmunityLevel,
1470
-		!aniState->ofdmWeakSigDetectOff ? "on" : "off",
1470
+		aniState->ofdmWeakSigDetect ? "on" : "off",
1471 1471
 		aniState->firstepLevel,
1472 1472
 		!aniState->mrcCCKOff ? "on" : "off",
1473 1473
 		aniState->listenTime,
@@ -1554,7 +1554,7 @@ static void ar5008_hw_ani_cache_ini_regs(struct ath_hw *ah)
1554 1554
 	/* these levels just got reset to defaults by the INI */
1555 1555
 	aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW;
1556 1556
 	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;
1558 1558
 	aniState->mrcCCKOff = 1; /* not available on pre AR9003 */
1559 1559
 }
1560 1560
 

+ 6
- 6
src/drivers/net/ath/ath9k/ath9k_ar9003_phy.c View File

@@ -859,18 +859,18 @@ static int ar9003_hw_ani_control(struct ath_hw *ah,
859 859
 			REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW,
860 860
 				    AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW);
861 861
 
862
-		if (!on != aniState->ofdmWeakSigDetectOff) {
862
+		if (on != aniState->ofdmWeakSigDetect) {
863 863
 			DBG2("ath9k: "
864 864
 				"** ch %d: ofdm weak signal: %s=>%s\n",
865 865
 				chan->channel,
866
-				!aniState->ofdmWeakSigDetectOff ?
866
+				aniState->ofdmWeakSigDetect ?
867 867
 				"on" : "off",
868 868
 				on ? "on" : "off");
869 869
 			if (on)
870 870
 				ah->stats.ast_ani_ofdmon++;
871 871
 			else
872 872
 				ah->stats.ast_ani_ofdmoff++;
873
-			aniState->ofdmWeakSigDetectOff = !on;
873
+			aniState->ofdmWeakSigDetect = on;
874 874
 		}
875 875
 		break;
876 876
 	}
@@ -1013,7 +1013,7 @@ static int ar9003_hw_ani_control(struct ath_hw *ah,
1013 1013
 			      AR_PHY_MRC_CCK_ENABLE, is_on);
1014 1014
 		REG_RMW_FIELD(ah, AR_PHY_MRC_CCK_CTRL,
1015 1015
 			      AR_PHY_MRC_CCK_MUX_REG, is_on);
1016
-		if (!is_on != aniState->mrcCCKOff) {
1016
+		if (!(is_on != aniState->mrcCCKOff)) {
1017 1017
 			DBG2("ath9k: "
1018 1018
 				"** ch %d: MRC CCK: %s=>%s\n",
1019 1019
 				chan->channel,
@@ -1037,7 +1037,7 @@ static int ar9003_hw_ani_control(struct ath_hw *ah,
1037 1037
 	DBG2("ath9k: "
1038 1038
 		"ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n",
1039 1039
 		aniState->spurImmunityLevel,
1040
-		!aniState->ofdmWeakSigDetectOff ? "on" : "off",
1040
+		aniState->ofdmWeakSigDetect ? "on" : "off",
1041 1041
 		aniState->firstepLevel,
1042 1042
 		!aniState->mrcCCKOff ? "on" : "off",
1043 1043
 		aniState->listenTime,
@@ -1137,7 +1137,7 @@ static void ar9003_hw_ani_cache_ini_regs(struct ath_hw *ah)
1137 1137
 	/* these levels just got reset to defaults by the INI */
1138 1138
 	aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW;
1139 1139
 	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;
1141 1141
 	aniState->mrcCCKOff = !ATH9K_ANI_ENABLE_MRC_CCK;
1142 1142
 }
1143 1143
 

Loading…
Cancel
Save