diff options
author | Joe Perches <joe@perches.com> | 2016-06-25 15:46:45 -0700 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2016-07-08 12:55:09 +0300 |
commit | 9ce221915a94c81779140fb52092b6f608c2ff33 (patch) | |
tree | 5490692bf8f52d81bf92827484e8f317c00672ac /drivers/net/wireless/realtek/rtlwifi/debug.h | |
parent | 78383ac951816a64657ca3e17868ad8c7c1b9393 (diff) | |
download | lwn-9ce221915a94c81779140fb52092b6f608c2ff33.tar.gz lwn-9ce221915a94c81779140fb52092b6f608c2ff33.zip |
rtlwifi: Create _rtl_dbg_trace function to reduce RT_TRACE code size
This debugging macro can expand to a lot of code.
Make it a function to reduce code size.
(x86-64 defconfig w/ all rtlwifi drivers and allyesconfig)
$ size drivers/net/wireless/realtek/rtlwifi/built-in.o*
text data bss dec hex filename
900083 200499 1907 1102489 10d299 drivers/net/wireless/realtek/rtlwifi/built-in.o.defconfig.new
1113597 200499 1907 1316003 1414a3 drivers/net/wireless/realtek/rtlwifi/built-in.o.defconfig.old
1746879 453503 8512 2208894 21b47e drivers/net/wireless/realtek/rtlwifi/built-in.o.new
2051965 503311 8512 2563788 271ecc drivers/net/wireless/realtek/rtlwifi/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/realtek/rtlwifi/debug.h')
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/debug.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.h b/drivers/net/wireless/realtek/rtlwifi/debug.h index fc794b3e9f4a..6156a79328c1 100644 --- a/drivers/net/wireless/realtek/rtlwifi/debug.h +++ b/drivers/net/wireless/realtek/rtlwifi/debug.h @@ -174,15 +174,16 @@ do { \ } \ } while (0) + +struct rtl_priv; + +__printf(5, 6) +void _rtl_dbg_trace(struct rtl_priv *rtlpriv, int comp, int level, + const char *modname, const char *fmt, ...); + #define RT_TRACE(rtlpriv, comp, level, fmt, ...) \ -do { \ - if (unlikely(((comp) & rtlpriv->dbg.global_debugcomponents) && \ - ((level) <= rtlpriv->dbg.global_debuglevel))) { \ - printk(KERN_DEBUG KBUILD_MODNAME ":%s():<%lx-%x> " fmt, \ - __func__, in_interrupt(), in_atomic(), \ - ##__VA_ARGS__); \ - } \ -} while (0) + _rtl_dbg_trace(rtlpriv, comp, level, \ + KBUILD_MODNAME, fmt, ##__VA_ARGS__) #define RTPRINT(rtlpriv, dbgtype, dbgflag, fmt, ...) \ do { \ |