Skip to content

Commit

Permalink
ath9k: dfs: use swap macro in ath9k_check_chirping
Browse files Browse the repository at this point in the history
Make use of the swap macro and remove unnecessary variable temp.
This makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
  • Loading branch information
Gustavo A. R. Silva authored and Kalle Valo committed Dec 2, 2017
1 parent 0fc66dd commit 626ab67
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/net/wireless/ath/ath9k/dfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,9 @@ static bool ath9k_check_chirping(struct ath_softc *sc, u8 *data,
fft = (struct ath9k_dfs_fft_40 *) (data + 2);
ath_dbg(common, DFS, "fixing datalen by 2\n");
}
if (IS_CHAN_HT40MINUS(ah->curchan)) {
int temp = is_ctl;
is_ctl = is_ext;
is_ext = temp;
}
if (IS_CHAN_HT40MINUS(ah->curchan))
swap(is_ctl, is_ext);

for (i = 0; i < FFT_NUM_SAMPLES; i++)
max_bin[i] = ath9k_get_max_index_ht40(fft + i, is_ctl,
is_ext);
Expand Down

0 comments on commit 626ab67

Please sign in to comment.