ath11k: add wrapper function to ath11k_dbg
PATCH 1/1 ath11k: add wrapper function to ath11k_dbg
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 <[email protected]>
--- drivers/net/wireless/ath/ath11k/debug.c | 6 +++--- drivers/net/wireless/ath/ath11k/debug.h | 18 +++++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath11k/debug.c +3 -3
@@ -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 ;
drivers/net/wireless/ath/ath11k/debug.h +11 -7
@@ -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_ */
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k