wifi: ath9k: use u32 for txgain indexes
authorDmitry Antipov <dmantipov@yandex.ru>
Wed, 23 Aug 2023 18:23:34 +0000 (21:23 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Wed, 20 Sep 2023 13:16:12 +0000 (16:16 +0300)
Since both 'ar9550_hw_get_modes_txgain_index()' and
'ar9561_hw_get_modes_txgain_index()' never returns
negative values, prefer 'u32' over 'int' and adjust
'ar9003_hw_process_ini()' accordingly.

Suggested-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
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/20230823182401.196270-2-dmantipov@yandex.ru
drivers/net/wireless/ath/ath9k/ar9003_phy.c

index 4731e661820941329e637234fac0566677899be4..6274d1624261424cee157ee01e5465b95454bb72 100644 (file)
@@ -766,10 +766,10 @@ static void ar9003_hw_prog_ini(struct ath_hw *ah,
        }
 }
 
-static int ar9550_hw_get_modes_txgain_index(struct ath_hw *ah,
+static u32 ar9550_hw_get_modes_txgain_index(struct ath_hw *ah,
                                            struct ath9k_channel *chan)
 {
-       int ret;
+       u32 ret;
 
        if (IS_CHAN_2GHZ(chan)) {
                if (IS_CHAN_HT40(chan))
@@ -791,7 +791,7 @@ static int ar9550_hw_get_modes_txgain_index(struct ath_hw *ah,
        return ret;
 }
 
-static int ar9561_hw_get_modes_txgain_index(struct ath_hw *ah,
+static u32 ar9561_hw_get_modes_txgain_index(struct ath_hw *ah,
                                            struct ath9k_channel *chan)
 {
        if (IS_CHAN_2GHZ(chan)) {
@@ -916,7 +916,7 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,
         * TXGAIN initvals.
         */
        if (AR_SREV_9550(ah) || AR_SREV_9531(ah) || AR_SREV_9561(ah)) {
-               int modes_txgain_index = 1;
+               u32 modes_txgain_index = 1;
 
                if (AR_SREV_9550(ah))
                        modes_txgain_index = ar9550_hw_get_modes_txgain_index(ah, chan);