From patchwork Tue Jun 18 10:52:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkateswara Naralasetty X-Patchwork-Id: 11001381 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 219E876 for ; Tue, 18 Jun 2019 10:52:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FB5D28A26 for ; Tue, 18 Jun 2019 10:52:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0394728A3F; Tue, 18 Jun 2019 10:52:44 +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 936EF28A37 for ; Tue, 18 Jun 2019 10:52:43 +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=dCQVFq2v2Dg7VBKweVTlBUdEG3Crx7Gp4IsFmQCoiE4=; b=IkO x06vZW6G0HWP9n5ayPSnLOlpEHGWKjRQQv5Byf1YSYnJGtiMXLTc56P8YwzkeY/z0rtLBizB38pLU IgZjcIXmj6W4RoAiWXehojvrnKQi+KSuLZL2wVXLLxAn+rz9EkIoUQQXydw7YZu4Rq/avDkxY8AOZ gbIe7ydk8pnxDyJYBBvuxxbfjXmDvxMq+9y91Hgf2ekeNuwXEs95M2k/5ZMvFiX6NQLcj60TotFQW cuOCbnPfwn/J6QNtyGP67am30dyw83cLTfB+ubGL3TnwPgkw15x+92UttW08Rq6666G9w3j/lWgup i81UJ9jHZzpwL+NRvT7sNrltjNpgMNg==; 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 1hdBjG-0002Qe-Sd; Tue, 18 Jun 2019 10:52:42 +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 1hdBjE-0002Q5-1C for ath11k@lists.infradead.org; Tue, 18 Jun 2019 10:52:41 +0000 Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by alexa-out-blr.qualcomm.com with ESMTP/TLS/AES256-SHA; 18 Jun 2019 16:22:37 +0530 X-IronPort-AV: E=McAfee;i="6000,8403,9291"; a="9716009" Received: from vnaralas-linux.qualcomm.com ([10.201.26.231]) by ironmsg02-blr.qualcomm.com with ESMTP; 18 Jun 2019 16:22:34 +0530 Received: by vnaralas-linux.qualcomm.com (Postfix, from userid 443942) id AFFC9DB4; Tue, 18 Jun 2019 16:22:32 +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:22:32 +0530 Message-Id: <1560855152-2609-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_035240_503583_EAB89424 X-CRM114-Status: UNSURE ( 7.03 ) 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 --- v2: * corrected one style issue drivers/net/wireless/ath/ath11k/debug.c | 6 +++--- drivers/net/wireless/ath/ath11k/debug.h | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 9 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..ebc807e 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; } @@ -272,4 +272,10 @@ 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_ */