ath9k: use AR9300_MAX_CHAINS when appropriate
authorWenli Looi <wlooi@ucalgary.ca>
Sun, 20 Mar 2022 23:30:07 +0000 (17:30 -0600)
committerKalle Valo <quic_kvalo@quicinc.com>
Fri, 25 Mar 2022 10:32:46 +0000 (12:32 +0200)
Replace other constants with AR9300_MAX_CHAINS when appropriate.

This change does not appear to affect the final binary.

Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220320233010.123106-4-wlooi@ucalgary.ca
drivers/net/wireless/ath/ath9k/ar9003_calib.c
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c

index dc24da1..6ca089f 100644 (file)
@@ -177,7 +177,7 @@ static void ar9003_hw_iqcal_collect(struct ath_hw *ah)
        int i;
 
        /* Accumulate IQ cal measures for active chains */
-       for (i = 0; i < AR5416_MAX_CHAINS; i++) {
+       for (i = 0; i < AR9300_MAX_CHAINS; i++) {
                if (ah->txchainmask & BIT(i)) {
                        ah->totalPowerMeasI[i] +=
                                REG_READ(ah, AR_PHY_CAL_MEAS_0(i));
index b0a4ca3..669b49b 100644 (file)
@@ -3911,7 +3911,7 @@ static void ar9003_hw_atten_apply(struct ath_hw *ah, struct ath9k_channel *chan)
        }
 
        /* Test value. if 0 then attenuation is unused. Don't load anything. */
-       for (i = 0; i < 3; i++) {
+       for (i = 0; i < AR9300_MAX_CHAINS; i++) {
                if (ah->txchainmask & BIT(i)) {
                        value = ar9003_hw_atten_chain_get(ah, i, chan);
                        REG_RMW_FIELD(ah, ext_atten_reg[i],
@@ -5126,7 +5126,7 @@ static int ar9003_hw_calibration_apply(struct ath_hw *ah, int frequency)
                frequency, correction[0], correction[1], correction[2]);
 
        /* Store calibrated noise floor values */
-       for (ichain = 0; ichain < AR5416_MAX_CHAINS; ichain++)
+       for (ichain = 0; ichain < AR9300_MAX_CHAINS; ichain++)
                if (mode) {
                        ah->nf_5g.cal[ichain] = nf_cal[ichain];
                        ah->nf_5g.pwr[ichain] = nf_pwr[ichain];