Commit 8b22523b authored by Joe Perches's avatar Joe Perches Committed by John W. Linville

ath5k: Use static const

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text	   data	    bss	    dec	    hex	filename
  11266	     56	   2464	  13786	   35da	drivers/net/wireless/ath/ath5k/ani.o.old
  11181	     56	   2464	  13701	   3585	drivers/net/wireless/ath/ath5k/ani.o.new
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 85be3d98
...@@ -63,15 +63,15 @@ ath5k_ani_set_noise_immunity_level(struct ath5k_hw *ah, int level) ...@@ -63,15 +63,15 @@ ath5k_ani_set_noise_immunity_level(struct ath5k_hw *ah, int level)
* so i stick with the HAL version for now... * so i stick with the HAL version for now...
*/ */
#if 0 #if 0
const s8 hi[] = { -18, -18, -16, -14, -12 }; static const s8 hi[] = { -18, -18, -16, -14, -12 };
const s8 lo[] = { -52, -56, -60, -64, -70 }; static const s8 lo[] = { -52, -56, -60, -64, -70 };
const s8 sz[] = { -34, -41, -48, -55, -62 }; static const s8 sz[] = { -34, -41, -48, -55, -62 };
const s8 fr[] = { -70, -72, -75, -78, -80 }; static const s8 fr[] = { -70, -72, -75, -78, -80 };
#else #else
const s8 sz[] = { -55, -62 }; static const s8 sz[] = { -55, -62 };
const s8 lo[] = { -64, -70 }; static const s8 lo[] = { -64, -70 };
const s8 hi[] = { -14, -12 }; static const s8 hi[] = { -14, -12 };
const s8 fr[] = { -78, -80 }; static const s8 fr[] = { -78, -80 };
#endif #endif
if (level < 0 || level >= ARRAY_SIZE(sz)) { if (level < 0 || level >= ARRAY_SIZE(sz)) {
ATH5K_ERR(ah->ah_sc, "noise immuniy level %d out of range", ATH5K_ERR(ah->ah_sc, "noise immuniy level %d out of range",
...@@ -102,7 +102,7 @@ ath5k_ani_set_noise_immunity_level(struct ath5k_hw *ah, int level) ...@@ -102,7 +102,7 @@ ath5k_ani_set_noise_immunity_level(struct ath5k_hw *ah, int level)
void void
ath5k_ani_set_spur_immunity_level(struct ath5k_hw *ah, int level) ath5k_ani_set_spur_immunity_level(struct ath5k_hw *ah, int level)
{ {
const int val[] = { 2, 4, 6, 8, 10, 12, 14, 16 }; static const int val[] = { 2, 4, 6, 8, 10, 12, 14, 16 };
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) {
...@@ -127,7 +127,7 @@ ath5k_ani_set_spur_immunity_level(struct ath5k_hw *ah, int level) ...@@ -127,7 +127,7 @@ ath5k_ani_set_spur_immunity_level(struct ath5k_hw *ah, int level)
void void
ath5k_ani_set_firstep_level(struct ath5k_hw *ah, int level) ath5k_ani_set_firstep_level(struct ath5k_hw *ah, int level)
{ {
const int val[] = { 0, 4, 8 }; static const int val[] = { 0, 4, 8 };
if (level < 0 || level >= ARRAY_SIZE(val)) { if (level < 0 || level >= ARRAY_SIZE(val)) {
ATH5K_ERR(ah->ah_sc, "firstep level %d out of range", level); ATH5K_ERR(ah->ah_sc, "firstep level %d out of range", level);
...@@ -151,12 +151,12 @@ ath5k_ani_set_firstep_level(struct ath5k_hw *ah, int level) ...@@ -151,12 +151,12 @@ ath5k_ani_set_firstep_level(struct ath5k_hw *ah, int level)
void void
ath5k_ani_set_ofdm_weak_signal_detection(struct ath5k_hw *ah, bool on) ath5k_ani_set_ofdm_weak_signal_detection(struct ath5k_hw *ah, bool on)
{ {
const int m1l[] = { 127, 50 }; static const int m1l[] = { 127, 50 };
const int m2l[] = { 127, 40 }; static const int m2l[] = { 127, 40 };
const int m1[] = { 127, 0x4d }; static const int m1[] = { 127, 0x4d };
const int m2[] = { 127, 0x40 }; static const int m2[] = { 127, 0x40 };
const int m2cnt[] = { 31, 16 }; static const int m2cnt[] = { 31, 16 };
const int m2lcnt[] = { 63, 48 }; static const int m2lcnt[] = { 63, 48 };
AR5K_REG_WRITE_BITS(ah, AR5K_PHY_WEAK_OFDM_LOW_THR, AR5K_REG_WRITE_BITS(ah, AR5K_PHY_WEAK_OFDM_LOW_THR,
AR5K_PHY_WEAK_OFDM_LOW_THR_M1, m1l[on]); AR5K_PHY_WEAK_OFDM_LOW_THR_M1, m1l[on]);
...@@ -192,7 +192,7 @@ ath5k_ani_set_ofdm_weak_signal_detection(struct ath5k_hw *ah, bool on) ...@@ -192,7 +192,7 @@ ath5k_ani_set_ofdm_weak_signal_detection(struct ath5k_hw *ah, bool on)
void void
ath5k_ani_set_cck_weak_signal_detection(struct ath5k_hw *ah, bool on) ath5k_ani_set_cck_weak_signal_detection(struct ath5k_hw *ah, bool on)
{ {
const int val[] = { 8, 6 }; static const int val[] = { 8, 6 };
AR5K_REG_WRITE_BITS(ah, AR5K_PHY_CCK_CROSSCORR, AR5K_REG_WRITE_BITS(ah, AR5K_PHY_CCK_CROSSCORR,
AR5K_PHY_CCK_CROSSCORR_WEAK_SIG_THR, val[on]); AR5K_PHY_CCK_CROSSCORR_WEAK_SIG_THR, val[on]);
ah->ah_sc->ani_state.cck_weak_sig = on; ah->ah_sc->ani_state.cck_weak_sig = on;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment