Skip to content

Commit

Permalink
ath9k: Simplify ar9003_hw_tx99_set_txpower
Browse files Browse the repository at this point in the history
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 <helmut.schaa@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
  • Loading branch information
Helmut Schaa authored and Kalle Valo committed May 9, 2016
1 parent e7ae328 commit b029171
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/net/wireless/ath/ath9k/ar9003_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit b029171

Please sign in to comment.