From patchwork Tue Jun 23 07:26:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shayne Chen X-Patchwork-Id: 215268 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_BASE64_TEXT, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9CFAC433E0 for ; Tue, 23 Jun 2020 07:27:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A29FA2072E for ; Tue, 23 Jun 2020 07:27:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="JqScRjgN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731158AbgFWH1P (ORCPT ); Tue, 23 Jun 2020 03:27:15 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:32222 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1731145AbgFWH1P (ORCPT ); Tue, 23 Jun 2020 03:27:15 -0400 X-UUID: e71a3a78342f4b7c851cead62a4928cf-20200623 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=AmTtxgjJJqlpgIBCkHW6b+asXc8NJTfuHQ0UTXoQ8Kc=; b=JqScRjgNgH02QytFICUfas7JJefBLhvTSXIqlUymRDfyl8Vi1F6Bf4Cg9kXPz4n1TN7j5bmuzCTtncMo8rgV4suBX6Eln3K9p7F/v+DdMpT2QEJthYMdANi+TczYP4/l29mXHjJgGhwAfx6jfl63hflsSBKPl2JVAh/7blT+tnU=; X-UUID: e71a3a78342f4b7c851cead62a4928cf-20200623 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 2086534945; Tue, 23 Jun 2020 15:27:13 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 23 Jun 2020 15:26:58 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 23 Jun 2020 15:26:58 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Ryder Lee , Evelyn Tsai , linux-mediatek , Shayne Chen Subject: [PATCH] mt76: mt7915: remove unused parameters in mt7915_puts_rate_txpower() Date: Tue, 23 Jun 2020 15:26:44 +0800 Message-ID: <20200623072644.15713-1-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-SNTS-SMTP: A7ABA8D085CB36C85595EA289AD50EA6BCFE3B40605EAB6508A8BC5EDC68B8832000:8 X-MTK: N Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Simplify and remove unused parameters in mt7915_puts_rate_txpower() function. Signed-off-by: Shayne Chen --- @Felix, please fold this into 5385563b1 mt76: mt7915: directly read per-rate tx power from registers, thanks. --- .../wireless/mediatek/mt76/mt7915/debugfs.c | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) -- 2.17.1 diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c index 92affd4..0331c49 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c @@ -300,8 +300,7 @@ mt7915_queues_read(struct seq_file *s, void *data) } static void -mt7915_puts_rate_txpower(struct seq_file *s, struct mt7915_dev *dev, - int band, bool ext_phy) +mt7915_puts_rate_txpower(struct seq_file *s, struct mt7915_phy *phy) { static const char * const sku_group_name[] = { "CCK", "OFDM", "HT20", "HT40", @@ -309,9 +308,17 @@ mt7915_puts_rate_txpower(struct seq_file *s, struct mt7915_dev *dev, "RU26", "RU52", "RU106", "RU242/SU20", "RU484/SU40", "RU996/SU80", "RU2x996/SU160" }; - u32 reg_base = MT_TMAC_FP0R0(ext_phy); + struct mt7915_dev *dev = dev_get_drvdata(s->private); + bool ext_phy = phy != &dev->phy; + u32 reg_base; int i, idx = 0; + if (!phy) + return; + + reg_base = MT_TMAC_FP0R0(ext_phy); + seq_printf(s, "\nBand %d\n", ext_phy); + for (i = 0; i < ARRAY_SIZE(mt7915_sku_group_len); i++) { u8 cnt, mcs_num = mt7915_sku_group_len[i]; s8 txpower[12]; @@ -356,19 +363,9 @@ static int mt7915_read_rate_txpower(struct seq_file *s, void *data) { struct mt7915_dev *dev = dev_get_drvdata(s->private); - struct mt76_phy *mphy = &dev->mphy; - enum nl80211_band band = mphy->chandef.chan->band; - - seq_puts(s, "Band 0: (unit: 0.5 dBm)\n"); - mt7915_puts_rate_txpower(s, dev, band, false); - if (dev->mt76.phy2) { - mphy = dev->mt76.phy2; - band = mphy->chandef.chan->band; - - seq_puts(s, "Band 1: (unit: 0.5 dBm)\n"); - mt7915_puts_rate_txpower(s, dev, band, true); - } + mt7915_puts_rate_txpower(s, &dev->phy); + mt7915_puts_rate_txpower(s, mt7915_ext_phy(dev)); return 0; }