wifi: ath9k: simplify ar9003_hw_process_ini()
authorDmitry Antipov <dmantipov@yandex.ru>
Wed, 23 Aug 2023 18:23:33 +0000 (21:23 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Wed, 20 Sep 2023 13:16:12 +0000 (16:16 +0300)
Since commit 8896934c1684 ("ath9k_hw: remove direct accesses to channel
mode flags") changes 'ar9550_hw_get_modes_txgain_index()' so it never
returns -EINVAL, and 'ar9561_hw_get_modes_txgain_index()' never returns
negative value too, an extra check in 'ar9003_hw_process_ini()' may be
dropped.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

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-1-dmantipov@yandex.ru
drivers/net/wireless/ath/ath9k/ar9003_phy.c

index a29c11f944a5b9d0ca96b7f2e13eeebe59f7e10c..4731e661820941329e637234fac0566677899be4 100644 (file)
@@ -925,9 +925,6 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,
                        modes_txgain_index =
                                ar9561_hw_get_modes_txgain_index(ah, chan);
 
-               if (modes_txgain_index < 0)
-                       return -EINVAL;
-
                REG_WRITE_ARRAY(&ah->iniModesTxGain, modes_txgain_index,
                                regWrites);
        } else {