From patchwork Tue Jun 18 10:46:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkateswara Naralasetty X-Patchwork-Id: 11001375 X-Patchwork-Delegate: kvalo@adurom.com 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 DFEEA76 for ; Tue, 18 Jun 2019 10:46:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF0BF28A1F for ; Tue, 18 Jun 2019 10:46:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2C8F28A49; Tue, 18 Jun 2019 10:46:08 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham 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 6CF4B28A1F for ; Tue, 18 Jun 2019 10:46:08 +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: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:In-Reply-To: References:List-Owner; bh=FS5ptK6mi9OvQ0GEp2XpulLAjTjXcXoCW0NHPZk18JQ=; b=DnY olqpT1bTQERXQ/SOXRMtP5saDlDUiXDgooZHDj0g5qxtv2e54ZEP7n+EhaMF45UQDMTX4kfyRDwmF Qh9RBix0xdtioHKVV7TVyZuF+Cc/OhREyzqGRXBCspGyxWqTHjEuFj0qcJZTwjarwGi/37UJjoCqO 8y6/YThb7W+x9aTc2ZSUwSTsI3HMH4KKNhbPkPVwur6wBrEr76bC3D//Ir1oGIHZNLIyI4w/NUdOj gyfL9icdqT+Mr7bF71kfTY20DYnFcOaTCxeVwkKK//YRFoV/e4trijVc2QPUJvYr64z5poxRZVEMg JCd3n4BMyHySkv+ZN6X4n9cJN2SJkYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hdBct-0000AR-R1; Tue, 18 Jun 2019 10:46:07 +0000 Received: from alexa-out-blr-02.qualcomm.com ([103.229.18.198] helo=alexa-out-blr.qualcomm.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hdBcq-00009t-9I for ath11k@lists.infradead.org; Tue, 18 Jun 2019 10:46:06 +0000 Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by alexa-out-blr.qualcomm.com with ESMTP/TLS/AES256-SHA; 18 Jun 2019 16:16:02 +0530 X-IronPort-AV: E=McAfee;i="6000,8403,9291"; a="10318822" Received: from vnaralas-linux.qualcomm.com ([10.201.26.231]) by ironmsg01-blr.qualcomm.com with ESMTP; 18 Jun 2019 16:16:02 +0530 Received: by vnaralas-linux.qualcomm.com (Postfix, from userid 443942) id 38D12DB4; Tue, 18 Jun 2019 16:16:01 +0530 (IST) From: Venkateswara Naralasetty To: ath11k@lists.infradead.org Subject: [PATCH] ath11k: add wrapper function to ath11k_dbg Date: Tue, 18 Jun 2019 16:16:00 +0530 Message-Id: <1560854760-29476-1-git-send-email-vnaralas@codeaurora.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190618_034604_756207_EC0E16D2 X-CRM114-Status: UNSURE ( 7.37 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Venkateswara Naralasetty MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch define a macro for ath11k_dbg() which improves the Rx performance by avoid calling ath11k_dbg() from ath11k_dp_rx_deliver_msdu() when no dbg_mask set. Signed-off-by: Venkateswara Naralasetty --- drivers/net/wireless/ath/ath11k/debug.c | 6 +++--- drivers/net/wireless/ath/ath11k/debug.h | 18 +++++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/debug.c b/drivers/net/wireless/ath/ath11k/debug.c index 69a2340..6e16c29 100644 --- a/drivers/net/wireless/ath/ath11k/debug.c +++ b/drivers/net/wireless/ath/ath11k/debug.c @@ -53,8 +53,8 @@ void ath11k_warn(struct ath11k_base *sc, const char *fmt, ...) } #ifdef CONFIG_ATH11K_DEBUG -void ath11k_dbg(struct ath11k_base *ab, enum ath11k_debug_mask mask, - const char *fmt, ...) +void __ath11k_dbg(struct ath11k_base *ab, enum ath11k_debug_mask mask, + const char *fmt, ...) { struct va_format vaf; va_list args; @@ -83,7 +83,7 @@ void ath11k_dbg_dump(struct ath11k_base *ab, if (ath11k_debug_mask & mask) { if (msg) - ath11k_dbg(ab, mask, "%s\n", msg); + __ath11k_dbg(ab, mask, "%s\n", msg); for (ptr = buf; (ptr - buf) < len; ptr += 16) { linebuflen = 0; diff --git a/drivers/net/wireless/ath/ath11k/debug.h b/drivers/net/wireless/ath/ath11k/debug.h index 5774f53..eb2c82d 100644 --- a/drivers/net/wireless/ath/ath11k/debug.h +++ b/drivers/net/wireless/ath/ath11k/debug.h @@ -106,17 +106,17 @@ __printf(2, 3) void ath11k_warn(struct ath11k_base *sc, const char *fmt, ...); extern unsigned int ath11k_debug_mask; #ifdef CONFIG_ATH11K_DEBUG -__printf(3, 4) void ath11k_dbg(struct ath11k_base *ab, - enum ath11k_debug_mask mask, - const char *fmt, ...); +__printf(3, 4) void __ath11k_dbg(struct ath11k_base *ab, + enum ath11k_debug_mask mask, + const char *fmt, ...); void ath11k_dbg_dump(struct ath11k_base *ab, enum ath11k_debug_mask mask, const char *msg, const char *prefix, const void *buf, size_t len); #else /* CONFIG_ATH11K_DEBUG */ -static inline int ath11k_dbg(struct ath11k_base *ab, - enum ath11k_debug_mask dbg_mask, - const char *fmt, ...) +static inline int __ath11k_dbg(struct ath11k_base *ab, + enum ath11k_debug_mask dbg_mask, + const char *fmt, ...) { return 0; } @@ -271,5 +271,9 @@ static inline void ath11k_sta_update_rx_duration(struct ath11k *ar, } #endif /* CONFIG_MAC80211_DEBUGFS*/ - +#define ath11k_dbg(ar, dbg_mask, fmt, ...) \ +do { \ + if (ath11k_debug_mask & dbg_mask) \ + __ath11k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \ +} while (0) #endif /* _ATH11K_DEBUG_H_ */