]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ath9k_hw: fix an off-by-one error in the PDADC boundaries calculation
authorFelix Fietkau <nbd@openwrt.org>
Sun, 11 Jul 2010 10:48:41 +0000 (12:48 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Aug 2010 17:54:10 +0000 (10:54 -0700)
commit 03b4776c408d2f4bf3a5d204e223724d154716d1 upstream.

PDADC values were only generated for values surrounding the target
index, however not for the target index itself, leading to a minor
error in the generated curve.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/ath/ath9k/eeprom_def.c

index 404a0341242c4531e49777d1639cd7600afbfdb1..1644b1a465e2f74c6a52cfaef6e5238419a28af7 100644 (file)
@@ -721,7 +721,7 @@ static void ath9k_hw_get_def_gain_boundaries_pdadcs(struct ath_hw *ah,
                                    vpdTableI[i][sizeCurrVpdTable - 2]);
                vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep);
 
-               if (tgtIndex > maxIndex) {
+               if (tgtIndex >= maxIndex) {
                        while ((ss <= tgtIndex) &&
                               (k < (AR5416_NUM_PDADC_VALUES - 1))) {
                                tmpVal = (int16_t)((vpdTableI[i][sizeCurrVpdTable - 1] +