ath5k: print error message if ANI levels are out of range
Since we have sysfs to manually set the ANI levels, we should print errors to the kernel log if the values are out of bounds. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
9537a16233
commit
4f424867dd
@@ -74,8 +74,8 @@ ath5k_ani_set_noise_immunity_level(struct ath5k_hw *ah, int level)
|
|||||||
const s8 fr[] = { -78, -80 };
|
const s8 fr[] = { -78, -80 };
|
||||||
#endif
|
#endif
|
||||||
if (level < 0 || level >= ARRAY_SIZE(sz)) {
|
if (level < 0 || level >= ARRAY_SIZE(sz)) {
|
||||||
ATH5K_DBG_UNLIMIT(ah->ah_sc, ATH5K_DEBUG_ANI,
|
ATH5K_ERR(ah->ah_sc, "noise immuniy level %d out of range",
|
||||||
"level out of range %d", level);
|
level);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,8 +106,8 @@ ath5k_ani_set_spur_immunity_level(struct ath5k_hw *ah, int level)
|
|||||||
|
|
||||||
if (level < 0 || level >= ARRAY_SIZE(val) ||
|
if (level < 0 || level >= ARRAY_SIZE(val) ||
|
||||||
level > ah->ah_sc->ani_state.max_spur_level) {
|
level > ah->ah_sc->ani_state.max_spur_level) {
|
||||||
ATH5K_DBG_UNLIMIT(ah->ah_sc, ATH5K_DEBUG_ANI,
|
ATH5K_ERR(ah->ah_sc, "spur immunity level %d out of range",
|
||||||
"level out of range %d", level);
|
level);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,8 +130,7 @@ ath5k_ani_set_firstep_level(struct ath5k_hw *ah, int level)
|
|||||||
const int val[] = { 0, 4, 8 };
|
const int val[] = { 0, 4, 8 };
|
||||||
|
|
||||||
if (level < 0 || level >= ARRAY_SIZE(val)) {
|
if (level < 0 || level >= ARRAY_SIZE(val)) {
|
||||||
ATH5K_DBG_UNLIMIT(ah->ah_sc, ATH5K_DEBUG_ANI,
|
ATH5K_ERR(ah->ah_sc, "firstep level %d out of range", level);
|
||||||
"level out of range %d", level);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user