]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: ath9k: remove TX99 power array zero init
authorRosen Penev <rosenp@gmail.com>
Sun, 17 May 2026 22:21:36 +0000 (15:21 -0700)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Sat, 6 Jun 2026 15:46:29 +0000 (08:46 -0700)
This array is fully initialized in the loop itself. No need to zero
initialize and then overwrite.

Remove static from the array. This was a holdover from when the array
was a static global variable. It no longer confers any benefit.

Also add a min() call to avoid the manual if/ternary operation.

Assisted-by: Codex:GPT-5.5
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://patch.msgid.link/20260517222136.1660347-1-rosenp@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath9k/ar9003_phy.c

index 6274d1624261424cee157ee01e5465b95454bb72..5d0433f2ae370e6263e7225dee18a86b52d96815 100644 (file)
@@ -1811,10 +1811,10 @@ static void ar9003_hw_tx99_stop(struct ath_hw *ah)
 
 static void ar9003_hw_tx99_set_txpower(struct ath_hw *ah, u8 txpower)
 {
-       static u8 p_pwr_array[ar9300RateSize] = { 0 };
+       u8 p_pwr_array[ar9300RateSize];
        unsigned int i;
 
-       txpower = txpower <= MAX_RATE_POWER ? txpower : MAX_RATE_POWER;
+       txpower = min(txpower, MAX_RATE_POWER);
        for (i = 0; i < ar9300RateSize; i++)
                p_pwr_array[i] = txpower;