netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 linux-next] ath5k: use swap() in ath5k_hw_get_median_noise_floor()
@ 2015-06-10 16:33 Fabian Frederick
  2015-06-10 19:52 ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Fabian Frederick @ 2015-06-10 16:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: Julia Lawall, Fabian Frederick, Jiri Slaby, Nick Kossifidis,
	Luis R. Rodriguez, Kalle Valo, linux-wireless, netdev

Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/net/wireless/ath/ath5k/phy.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 0fce1c7..ef108a3 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -1566,17 +1566,13 @@ static s16
 ath5k_hw_get_median_noise_floor(struct ath5k_hw *ah)
 {
 	s16 sort[ATH5K_NF_CAL_HIST_MAX];
-	s16 tmp;
 	int i, j;
 
 	memcpy(sort, ah->ah_nfcal_hist.nfval, sizeof(sort));
 	for (i = 0; i < ATH5K_NF_CAL_HIST_MAX - 1; i++) {
 		for (j = 1; j < ATH5K_NF_CAL_HIST_MAX - i; j++) {
-			if (sort[j] > sort[j - 1]) {
-				tmp = sort[j];
-				sort[j] = sort[j - 1];
-				sort[j - 1] = tmp;
-			}
+			if (sort[j] > sort[j - 1])
+				swap(sort[j], sort[j]);
 		}
 	}
 	for (i = 0; i < ATH5K_NF_CAL_HIST_MAX; i++) {
-- 
2.4.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-11  5:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-10 16:33 [PATCH 1/1 linux-next] ath5k: use swap() in ath5k_hw_get_median_noise_floor() Fabian Frederick
2015-06-10 19:52 ` Joe Perches
     [not found]   ` <1433965966.32331.25.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2015-06-10 19:59     ` Fabian Frederick
2015-06-10 20:29       ` Julia Lawall
     [not found]         ` <alpine.DEB.2.02.1506102228560.1986-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
2015-06-11  5:06           ` Fabian Frederick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).