mirror of
https://github.com/torvalds/linux.git
synced 2024-12-21 10:31:54 +00:00
rtlwifi: add CONFIG_RTLWIFI_DEBUG to remove all of the debug logging code
It does seem odd though to have a DBG_EMERG and not always emit it. What might also be useful for any embedded use is to add CONFIG_RTLWIFI_DEBUG to conditionally remove all of the debug logging code to reduce the largish object size. This reduces the object size by about 1/3 (250KB) when CONFIG_RTLWIFI_DEBUG is not set. $ size drivers/net/wireless/rtlwifi/built-in.o* text data bss dec hex filename 368722 55333 94224 518279 7e887 drivers/net/wireless/rtlwifi/built-in.o.new 586904 55333 127216 769453 bbdad drivers/net/wireless/rtlwifi/built-in.o.old Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
f56e7eb4dd
commit
481b9606ec
@ -49,6 +49,11 @@ config RTLWIFI
|
|||||||
depends on RTL8192CE || RTL8192CU || RTL8192SE || RTL8192DE
|
depends on RTL8192CE || RTL8192CU || RTL8192SE || RTL8192DE
|
||||||
default m
|
default m
|
||||||
|
|
||||||
|
config RTLWIFI_DEBUG
|
||||||
|
tristate "Additional debugging output"
|
||||||
|
depends on RTL8192CE || RTL8192CU || RTL8192SE || RTL8192DE
|
||||||
|
default y
|
||||||
|
|
||||||
config RTL8192C_COMMON
|
config RTL8192C_COMMON
|
||||||
tristate
|
tristate
|
||||||
depends on RTL8192CE || RTL8192CU
|
depends on RTL8192CE || RTL8192CU
|
||||||
|
@ -156,6 +156,8 @@ enum dbgp_flag_e {
|
|||||||
DBGP_TYPE_MAX
|
DBGP_TYPE_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef CONFIG_RTLWIFI_DEBUG
|
||||||
|
|
||||||
#define RT_ASSERT(_exp, fmt, ...) \
|
#define RT_ASSERT(_exp, fmt, ...) \
|
||||||
do { \
|
do { \
|
||||||
if (!(_exp)) { \
|
if (!(_exp)) { \
|
||||||
@ -195,5 +197,37 @@ do { \
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
struct rtl_priv;
|
||||||
|
|
||||||
|
__printf(2, 3)
|
||||||
|
static inline void RT_ASSERT(int exp, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
__printf(4, 5)
|
||||||
|
static inline void RT_TRACE(struct rtl_priv *rtlpriv,
|
||||||
|
int comp, int level,
|
||||||
|
const char *fmt, ...)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
__printf(4, 5)
|
||||||
|
static inline void RTPRINT(struct rtl_priv *rtlpriv,
|
||||||
|
int dbgtype, int dbgflag,
|
||||||
|
const char *fmt, ...)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void RT_PRINT_DATA(struct rtl_priv *rtlpriv,
|
||||||
|
int comp, int level,
|
||||||
|
const char *titlestring,
|
||||||
|
const void *hexdata, size_t hexdatalen)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
void rtl_dbgp_flag_init(struct ieee80211_hw *hw);
|
void rtl_dbgp_flag_init(struct ieee80211_hw *hw);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user