Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[pandora-kernel.git] / drivers / net / wireless / ath / ath9k / ar9002_phy.c
index c00cdc6..7d68d61 100644 (file)
@@ -175,13 +175,15 @@ static void ar9002_hw_spur_mitigate(struct ath_hw *ah,
        int upper, lower, cur_vit_mask;
        int tmp, newVal;
        int i;
-       int pilot_mask_reg[4] = { AR_PHY_TIMING7, AR_PHY_TIMING8,
-                         AR_PHY_PILOT_MASK_01_30, AR_PHY_PILOT_MASK_31_60
+       static const int pilot_mask_reg[4] = {
+               AR_PHY_TIMING7, AR_PHY_TIMING8,
+               AR_PHY_PILOT_MASK_01_30, AR_PHY_PILOT_MASK_31_60
        };
-       int chan_mask_reg[4] = { AR_PHY_TIMING9, AR_PHY_TIMING10,
-                        AR_PHY_CHANNEL_MASK_01_30, AR_PHY_CHANNEL_MASK_31_60
+       static const int chan_mask_reg[4] = {
+               AR_PHY_TIMING9, AR_PHY_TIMING10,
+               AR_PHY_CHANNEL_MASK_01_30, AR_PHY_CHANNEL_MASK_31_60
        };
-       int inc[4] = { 0, 100, 0, 0 };
+       static const int inc[4] = { 0, 100, 0, 0 };
        struct chan_centers centers;
 
        int8_t mask_m[123];
@@ -201,13 +203,14 @@ static void ar9002_hw_spur_mitigate(struct ath_hw *ah,
        for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) {
                cur_bb_spur = ah->eep_ops->get_spur_channel(ah, i, is2GHz);
 
+               if (AR_NO_SPUR == cur_bb_spur)
+                       break;
+
                if (is2GHz)
                        cur_bb_spur = (cur_bb_spur / 10) + AR_BASE_FREQ_2GHZ;
                else
                        cur_bb_spur = (cur_bb_spur / 10) + AR_BASE_FREQ_5GHZ;
 
-               if (AR_NO_SPUR == cur_bb_spur)
-                       break;
                cur_bb_spur = cur_bb_spur - freq;
 
                if (IS_CHAN_HT40(chan)) {
@@ -473,21 +476,21 @@ static void ar9002_hw_do_getnf(struct ath_hw *ah,
        int16_t nf;
 
        nf = MS(REG_READ(ah, AR_PHY_CCA), AR9280_PHY_MINCCA_PWR);
-       nfarray[0] = sign_extend(nf, 9);
+       nfarray[0] = sign_extend32(nf, 8);
 
        nf = MS(REG_READ(ah, AR_PHY_EXT_CCA), AR9280_PHY_EXT_MINCCA_PWR);
        if (IS_CHAN_HT40(ah->curchan))
-               nfarray[3] = sign_extend(nf, 9);
+               nfarray[3] = sign_extend32(nf, 8);
 
        if (AR_SREV_9285(ah) || AR_SREV_9271(ah))
                return;
 
        nf = MS(REG_READ(ah, AR_PHY_CH1_CCA), AR9280_PHY_CH1_MINCCA_PWR);
-       nfarray[1] = sign_extend(nf, 9);
+       nfarray[1] = sign_extend32(nf, 8);
 
        nf = MS(REG_READ(ah, AR_PHY_CH1_EXT_CCA), AR9280_PHY_CH1_EXT_MINCCA_PWR);
        if (IS_CHAN_HT40(ah->curchan))
-               nfarray[4] = sign_extend(nf, 9);
+               nfarray[4] = sign_extend32(nf, 8);
 }
 
 static void ar9002_hw_set_nf_limits(struct ath_hw *ah)