Explorar el Código

[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 hace 9 años
padre
commit
1b56452121

+ 1
- 1
src/drivers/net/ath/ath9k/ani.h Ver fichero

125
 	u8 mrcCCKOff;
125
 	u8 mrcCCKOff;
126
 	u8 spurImmunityLevel;
126
 	u8 spurImmunityLevel;
127
 	u8 firstepLevel;
127
 	u8 firstepLevel;
128
-	u8 ofdmWeakSigDetectOff;
128
+	u8 ofdmWeakSigDetect;
129
 	u8 cckWeakSigThreshold;
129
 	u8 cckWeakSigThreshold;
130
 	u32 listenTime;
130
 	u32 listenTime;
131
 	int32_t rssiThrLow;
131
 	int32_t rssiThrLow;

+ 8
- 8
src/drivers/net/ath/ath9k/ath9k_ani.c Ver fichero

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

+ 9
- 9
src/drivers/net/ath/ath9k/ath9k_ar5008_phy.c Ver fichero

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

+ 6
- 6
src/drivers/net/ath/ath9k/ath9k_ar9003_phy.c Ver fichero

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

Loading…
Cancelar
Guardar