From patchwork Thu Sep 20 09:11:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10607229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EB9EA1508 for ; Thu, 20 Sep 2018 09:25:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB0612CDC1 for ; Thu, 20 Sep 2018 09:25:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF65C2CDCD; Thu, 20 Sep 2018 09:25:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 755A72CDC1 for ; Thu, 20 Sep 2018 09:25:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=dX4++OeYilJ7A5xFudUqjhPFNVPGKiEQsrmEOg2eJqI=; b=Q/bastBdUhq7Olq9Ra5xpqqkQ+ kRwQGoXsgQ2CjK3S5WTPHDaflMiI5oPv56xy13/0IIcaIi1cNMVIWDKOR6LxonUzc/YzzyHv51LYw wWeQP/Y44u710XYk91XvtYoXAIBoNIkAAjtAnoEf78671i8cB44eHDhVuh6uq9jWc/kTvfBitiFxI CuDkoEITYur2jRxinOquc69b/GK6x/uv7lBiYGKbSFTvc13KUpcrlkXN3bDZDNaYAVSar2eMQAn8g O4XfEKzczlKxtDqdI4thqAmT+LEJKC6bRH5G14342A71hUg2qFeHlU+l8+u6hgdxAYmqPNpjYpG/K AcQI7Q8g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2vDI-0007ek-6p; Thu, 20 Sep 2018 09:25:32 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2vCp-0006Dy-5G for linux-mediatek@bombadil.infradead.org; Thu, 20 Sep 2018 09:25:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CP8V5OkdU81ZZErBUxE2LyQjjz+NRtj0pdjdYtJzswM=; b=WBhp+984cQfNo0iTe2g2ztzvN 4mFqfzdc6T+H0TCyoiJDq/GXuqHPjA6+INuKXgKj3avIA2wHGershrWu9zBDui9ukGRtimMwygUFl v08uq/jPsmzWwn7huOJOIpUvJ/ssJHMBFyE+rY1N6qo82oAtolpQuQyxzA5KBxCqnv3+/9aTnw4C0 DDszRn/l1jRJdnLCf/h4ACNl84lJClF/Iyu52lfsg9km6jabNE70oMwtzrFjih/zUwLAEWOxaMTCq +00DQeFfD0tbSoNaLb7JkmikhZZ/U2TSfJDp3kDiGQW038E7+Rd1NaCqVM4eiHhzom0SQAiR9YRAx 5uTG9uBgQ==; Received: from mail-wr1-f65.google.com ([209.85.221.65]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2v0n-00048m-G1 for linux-mediatek@lists.infradead.org; Thu, 20 Sep 2018 09:12:39 +0000 Received: by mail-wr1-f65.google.com with SMTP id e1-v6so8600685wrt.3 for ; Thu, 20 Sep 2018 02:12:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CP8V5OkdU81ZZErBUxE2LyQjjz+NRtj0pdjdYtJzswM=; b=adoI3CFo91B/yIgtneSv24TA46eaj1iPWE9PjUaAZI9OnV6SyQ/36a8U/bSKpW0WsU IJMWobUK75WtU+27ULACz5DRbUV91s1z03AlIEz/+dXT+MTzyKTFQNDrD5C72WGLAUrp CGb8Upz/9sEgrUROG3dQl2khZRW9robp2COlWCkMkKl3D1SHnyGeHTNt9mxxm7xEtlDR Oi8bVxhJ91D2HPs0Oj2G9wliy4P6UEQY/lNqwWNYr6KK82y4hGffXyNM2DOIT8jmdtsm Go3kjpylaXHY1louVKG9z84mcggUDILYotQxIi1eNJyeV7CPg/Zel729r5Os5ObHI+x7 icFA== X-Gm-Message-State: APzg51CzjZsBQMYKj71Aw1U8R21XrZM16qq1G3AhMqJrV7vDMRGvs7Ng KOoTBFZ0Y87WbaS1zNHW9kUmzQ== X-Google-Smtp-Source: ANB0VdbD2q756Jt5L32W4ixBudZI1BkQws4C8+K+ilCRrODHhuZk0b+pQ0dBsXz6m6GV/udaS3Tidw== X-Received: by 2002:adf:f984:: with SMTP id f4-v6mr32801750wrr.105.1537434744899; Thu, 20 Sep 2018 02:12:24 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 34-v6sm35501691wra.20.2018.09.20.02.12.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 02:12:24 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Subject: [PATCH 01/20] mt76: move seq_put_array in mt76-core module Date: Thu, 20 Sep 2018 11:11:48 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180920_101237_555055_615FFD6E X-CRM114-Status: GOOD ( 12.07 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sgruszka@redhat.com, linux-mediatek@lists.infradead.org, linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Move seq_put_array utility routine in mt76-core module in order to be reused in mt76x0 driver Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/debugfs.c | 12 +++++++ drivers/net/wireless/mediatek/mt76/mt76.h | 2 ++ .../wireless/mediatek/mt76/mt76x2_debugfs.c | 31 ++++++------------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/debugfs.c b/drivers/net/wireless/mediatek/mt76/debugfs.c index a38d05dea599..03ce635334fa 100644 --- a/drivers/net/wireless/mediatek/mt76/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/debugfs.c @@ -56,6 +56,18 @@ mt76_queues_read(struct seq_file *s, void *data) return 0; } +void mt76_seq_puts_array(struct seq_file *file, const char *str, + s8 *val, int len) +{ + int i; + + seq_printf(file, "%10s:", str); + for (i = 0; i < len; i++) + seq_printf(file, " %2d", val[i]); + seq_puts(file, "\n"); +} +EXPORT_SYMBOL_GPL(mt76_seq_puts_array); + struct dentry *mt76_register_debugfs(struct mt76_dev *dev) { struct dentry *dir; diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index dbda49243a10..b4980959efa7 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -539,6 +539,8 @@ int mt76_register_device(struct mt76_dev *dev, bool vht, void mt76_unregister_device(struct mt76_dev *dev); struct dentry *mt76_register_debugfs(struct mt76_dev *dev); +void mt76_seq_puts_array(struct seq_file *file, const char *str, + s8 *val, int len); int mt76_eeprom_init(struct mt76_dev *dev, int len); void mt76_eeprom_override(struct mt76_dev *dev); diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_debugfs.c b/drivers/net/wireless/mediatek/mt76/mt76x2_debugfs.c index 77b5ff1be05f..2cd0d8200a57 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_debugfs.c @@ -47,33 +47,22 @@ mt76x2_ampdu_stat_open(struct inode *inode, struct file *f) return single_open(f, mt76x2_ampdu_stat_read, inode->i_private); } -static void -seq_puts_array(struct seq_file *file, const char *str, s8 *val, int len) -{ - int i; - - seq_printf(file, "%10s:", str); - for (i = 0; i < len; i++) - seq_printf(file, " %2d", val[i]); - seq_puts(file, "\n"); -} - static int read_txpower(struct seq_file *file, void *data) { struct mt76x2_dev *dev = dev_get_drvdata(file->private); seq_printf(file, "Target power: %d\n", dev->target_power); - seq_puts_array(file, "Delta", dev->target_power_delta, - ARRAY_SIZE(dev->target_power_delta)); - seq_puts_array(file, "CCK", dev->rate_power.cck, - ARRAY_SIZE(dev->rate_power.cck)); - seq_puts_array(file, "OFDM", dev->rate_power.ofdm, - ARRAY_SIZE(dev->rate_power.ofdm)); - seq_puts_array(file, "HT", dev->rate_power.ht, - ARRAY_SIZE(dev->rate_power.ht)); - seq_puts_array(file, "VHT", dev->rate_power.vht, - ARRAY_SIZE(dev->rate_power.vht)); + mt76_seq_puts_array(file, "Delta", dev->target_power_delta, + ARRAY_SIZE(dev->target_power_delta)); + mt76_seq_puts_array(file, "CCK", dev->rate_power.cck, + ARRAY_SIZE(dev->rate_power.cck)); + mt76_seq_puts_array(file, "OFDM", dev->rate_power.ofdm, + ARRAY_SIZE(dev->rate_power.ofdm)); + mt76_seq_puts_array(file, "HT", dev->rate_power.ht, + ARRAY_SIZE(dev->rate_power.ht)); + mt76_seq_puts_array(file, "VHT", dev->rate_power.vht, + ARRAY_SIZE(dev->rate_power.vht)); return 0; }