Skip to content
Commit e10ec6ea authored by Mahmoud Maatuq's avatar Mahmoud Maatuq Committed by Kalle Valo
Browse files

wifi: ath5k: ath5k_hw_get_median_noise_floor(): use swap()



coccinielle reported the following:
./drivers/net/wireless/ath/ath5k/phy.c:1573:25-26: WARNING opportunity for swap()

while trying to fix the above warning, it reveals that ath5k_hw_get_median_noise_floor()
had open-coded sort() functionality. Since ath5k_hw_get_median_noise_floor() only
executes once every 10 seconds, any extra overhead due to sort() calling
its "compare" and "swap" functions can be ignored, so replace the
existing logic with a call to sort().

Signed-off-by: default avatarMahmoud Maatuq <mahmoudmatook.mm@gmail.com>
Suggested-by: default avatarJiri Slaby <jirislaby@kernel.org>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230815040819.649455-1-mahmoudmatook.mm@gmail.com
parent 3b86f86d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment