mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
ath9k: Simplify ar9003_hw_tx99_set_txpower
There's no need to keep the same for loop twice in the code. Move the txpower cap before the loop to reduce code complexity. Signed-off-by: Helmut Schaa <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
This commit is contained in:
parent
e7ae328961
commit
b0291715d3
1 changed files with 3 additions and 7 deletions
|
|
@ -1844,13 +1844,9 @@ static void ar9003_hw_tx99_set_txpower(struct ath_hw *ah, u8 txpower)
|
|||
static u8 p_pwr_array[ar9300RateSize] = { 0 };
|
||||
unsigned int i;
|
||||
|
||||
if (txpower <= MAX_RATE_POWER) {
|
||||
for (i = 0; i < ar9300RateSize; i++)
|
||||
p_pwr_array[i] = txpower;
|
||||
} else {
|
||||
for (i = 0; i < ar9300RateSize; i++)
|
||||
p_pwr_array[i] = MAX_RATE_POWER;
|
||||
}
|
||||
txpower = txpower <= MAX_RATE_POWER ? txpower : MAX_RATE_POWER;
|
||||
for (i = 0; i < ar9300RateSize; i++)
|
||||
p_pwr_array[i] = txpower;
|
||||
|
||||
ar9003_hw_tx_power_regwrite(ah, p_pwr_array);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue