From patchwork Fri Aug 10 11:17:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sujith Manoharan X-Patchwork-Id: 1305091 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 2F4FCDF215 for ; Fri, 10 Aug 2012 11:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752508Ab2HJLSp (ORCPT ); Fri, 10 Aug 2012 07:18:45 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:5925 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752254Ab2HJLSo (ORCPT ); Fri, 10 Aug 2012 07:18:44 -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=1344597525; x=1376133525; h=from:mime-version:content-transfer-encoding:message-id: date:to:cc:subject; bh=5SAqgxG/1qhLAi9aVPTAnjoDucA6RW74waMXKhu1Hsc=; b=VGEL0DLKSXrWpskxXqpzxgIOLK/cTgMnbdp3dP8l0+bUMp1DbQAL+tgQ TGsKBieRat2q0Avpe9hHuDPugLg4mDF5TbNQ0I0X+Lqo8rqlt2Uj7Cccv s4fBF77BNWuddTzu+L1QK0S/7AIewlcc9olZrBfPUQ9OPbtKRePmlSfym s=; X-IronPort-AV: E=McAfee;i="5400,1158,6798"; a="223736964" Received: from ironmsg04-r.qualcomm.com ([172.30.46.18]) by wolverine01.qualcomm.com with ESMTP; 10 Aug 2012 04:18:45 -0700 X-IronPort-AV: E=Sophos;i="4.77,745,1336374000"; d="scan'208";a="365821236" Received: from nasanexhc04.na.qualcomm.com ([172.30.48.17]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 10 Aug 2012 04:18:45 -0700 Received: from alfalfa (172.30.48.1) by qcmail1.qualcomm.com (172.30.48.17) with Microsoft SMTP Server (TLS) id 14.2.309.2; Fri, 10 Aug 2012 04:18:43 -0700 From: Sujith Manoharan MIME-Version: 1.0 Message-ID: <20516.60874.416293.305770@gargle.gargle.HOWL> Date: Fri, 10 Aug 2012 16:47:30 +0530 To: X-Mailer: VM 8.2.0b under 24.1.1 (x86_64-unknown-linux-gnu) CC: Subject: [PATCH 15/15] ath9k: tune rc_stats to display only valid rates 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 From: Rajkumar Manoharan This could make rc_stats more simpler and ease the debugging. Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath9k/rc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 4a04fff..4b12c34 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c @@ -1355,7 +1355,7 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf, struct ath_rate_priv *rc = file->private_data; char *buf; unsigned int len = 0, max; - int i = 0; + int rix; ssize_t retval; if (rc->rate_table == NULL) @@ -1371,7 +1371,8 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf, "HT", "MCS", "Rate", "Success", "Retries", "XRetries", "PER"); - for (i = 0; i < rc->rate_table_size; i++) { + for (rix = 0; rix < rc->max_valid_rate; rix++) { + u8 i = rc->valid_rate_index[rix]; u32 ratekbps = rc->rate_table->info[i].ratekbps; struct ath_rc_stats *stats = &rc->rcstats[i]; char mcs[5];