Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933345AbbFJTxB (ORCPT ); Wed, 10 Jun 2015 15:53:01 -0400 Received: from smtprelay0092.hostedemail.com ([216.40.44.92]:40766 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752494AbbFJTwu (ORCPT ); Wed, 10 Jun 2015 15:52:50 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::,RULES_HIT:41:355:379:541:599:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3867:4321:5007:6119:6261:6642:7904:10004:10400:10848:11026:11232:11473:11657:11658:11914:12043:12114:12438:12517:12519:12740:13069:13255:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: copy39_8ccfd162bd222 X-Filterd-Recvd-Size: 1875 Message-ID: <1433965966.32331.25.camel@perches.com> Subject: Re: [PATCH 1/1 linux-next] ath5k: use swap() in ath5k_hw_get_median_noise_floor() From: Joe Perches To: Fabian Frederick Cc: linux-kernel@vger.kernel.org, Julia Lawall , Jiri Slaby , Nick Kossifidis , "Luis R. Rodriguez" , Kalle Valo , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Date: Wed, 10 Jun 2015 12:52:46 -0700 In-Reply-To: <1433954015-24872-1-git-send-email-fabf@skynet.be> References: <1433954015-24872-1-git-send-email-fabf@skynet.be> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1048 Lines: 33 On Wed, 2015-06-10 at 18:33 +0200, Fabian Frederick wrote: > Use kernel.h macro definition. > > Thanks to Julia Lawall for Coccinelle scripting support. [] > diff --git 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]); swap(a, a) doesn't look useful. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/