Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932613AbbFJU3a (ORCPT ); Wed, 10 Jun 2015 16:29:30 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:33320 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754386AbbFJU3V (ORCPT ); Wed, 10 Jun 2015 16:29:21 -0400 X-IronPort-AV: E=Sophos;i="5.13,589,1427752800"; d="scan'208";a="164416667" Date: Wed, 10 Jun 2015 22:29:18 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: Fabian Frederick cc: Joe Perches , "Luis R. Rodriguez" , Nick Kossifidis , linux-wireless@vger.kernel.org, Jiri Slaby , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kalle Valo Subject: Re: [PATCH 1/1 linux-next] ath5k: use swap() in ath5k_hw_get_median_noise_floor() In-Reply-To: <1121998377.24127.1433966378845.open-xchange@webmail.nmp.proximus.be> Message-ID: References: <1433954015-24872-1-git-send-email-fabf@skynet.be> <1433965966.32331.25.camel@perches.com> <1121998377.24127.1433966378845.open-xchange@webmail.nmp.proximus.be> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-224748411-1433968160=:1986" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1966 Lines: 61 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-224748411-1433968160=:1986 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Wed, 10 Jun 2015, Fabian Frederick wrote: > > > > On 10 June 2015 at 21:52 Joe Perches wrote: > > > > > > 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. > Thanks a lot Joe, I'll fix this one :) How did it come out like that? julia > > Regards, > Fabian > > > > > --8323328-224748411-1433968160=:1986-- -- 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/