From patchwork Tue Aug 7 01:13:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sujith Manoharan X-Patchwork-Id: 1282261 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6A42C3FC23 for ; Tue, 7 Aug 2012 01:15:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757076Ab2HGBPH (ORCPT ); Mon, 6 Aug 2012 21:15:07 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:7830 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757055Ab2HGBPG (ORCPT ); Mon, 6 Aug 2012 21:15:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1344302107; x=1375838107; h=from:mime-version:content-transfer-encoding:message-id: date:to:cc:subject; bh=3hLqNZU84Fpvz10vBqdFLFoEkQ0PHII61rEK0iOxkXM=; b=Sp5AgLAebNOI+yaEnCQyyUDNEwMNVgSA5HHLxM6M7FN8y3x9gmoYD7gj Ue8b5NWITcZcaKWqrIFdSUbaCMCaP3mWIUtqTaoDfV4D0OzQBsN7dR3X+ OPAhhWXR/8SmQOkkOqgL0vAZ9PSjUGPVsPOoturYRkY86pHOB9hIlTXuq c=; X-IronPort-AV: E=McAfee;i="5400,1158,6795"; a="221455257" Received: from ironmsg03-r.qualcomm.com ([172.30.46.17]) by wolverine01.qualcomm.com with ESMTP; 06 Aug 2012 18:15:06 -0700 X-IronPort-AV: E=Sophos;i="4.77,723,1336374000"; d="scan'208";a="306250862" Received: from nasanexhc08.na.qualcomm.com ([172.30.39.7]) by Ironmsg03-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 06 Aug 2012 18:15:06 -0700 Received: from nasanexhc05.na.qualcomm.com (172.30.48.2) by nasanexhc08.na.qualcomm.com (172.30.39.7) with Microsoft SMTP Server (TLS) id 14.2.309.2; Mon, 6 Aug 2012 18:15:05 -0700 Received: from sarge (172.30.48.1) by qcmail1.qualcomm.com (172.30.48.2) with Microsoft SMTP Server (TLS) id 14.2.309.2; Mon, 6 Aug 2012 18:15:04 -0700 From: Sujith Manoharan MIME-Version: 1.0 Message-ID: <20512.27593.328878.831452@gargle.gargle.HOWL> Date: Tue, 7 Aug 2012 06:43:45 +0530 To: X-Mailer: VM 8.2.0b under 24.1.1 (x86_64-unknown-linux-gnu) CC: Subject: [RFC 04/14] ath9k: Cleanup ath_rc_setvalid_htrates X-Originating-IP: [172.30.48.1] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Signed-off-by: Sujith Manoharan --- drivers/net/wireless/ath/ath9k/rc.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index a34f678..69745ad 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c @@ -552,15 +552,16 @@ static u8 ath_rc_setvalid_htrates(struct ath_rate_priv *ath_rc_priv) { const struct ath_rate_table *rate_table = ath_rc_priv->rate_table; struct ath_rateset *rateset = &ath_rc_priv->neg_ht_rates; - u32 capflag = ath_rc_priv->ht_cap; - u8 i, j, hi = 0; + u32 phy, capflag = ath_rc_priv->ht_cap; + u16 rate_flags; + u8 i, j, hi = 0, rate, dot11rate, valid_rate_count; for (i = 0; i < rateset->rs_nrates; i++) { for (j = 0; j < rate_table->rate_cnt; j++) { - u32 phy = rate_table->info[j].phy; - u16 rate_flags = rate_table->info[j].rate_flags; - u8 rate = rateset->rs_rates[i]; - u8 dot11rate = rate_table->info[j].dot11rate; + phy = rate_table->info[j].phy; + rate_flags = rate_table->info[j].rate_flags; + rate = rateset->rs_rates[i]; + dot11rate = rate_table->info[j].dot11rate; if ((rate != dot11rate) || !WLAN_RC_PHY_HT(phy) || !(rate_flags & WLAN_RC_CAP_STREAM(capflag)) || @@ -570,8 +571,8 @@ static u8 ath_rc_setvalid_htrates(struct ath_rate_priv *ath_rc_priv) if (!ath_rc_valid_phyrate(phy, capflag, 0)) continue; - ath_rc_priv->valid_phy_rateidx[phy] - [ath_rc_priv->valid_phy_ratecnt[phy]] = j; + valid_rate_count = ath_rc_priv->valid_phy_ratecnt[phy]; + ath_rc_priv->valid_phy_rateidx[phy][valid_rate_count] = j; ath_rc_priv->valid_phy_ratecnt[phy] += 1; ath_rc_set_valid_rate_idx(ath_rc_priv, j, 1); hi = max(hi, j);