diff options
author | Joe Perches <joe@perches.com> | 2012-01-05 11:29:07 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-24 14:07:41 -0500 |
commit | 481b9606ec7276401c7f746fe37873855c49d1b8 (patch) | |
tree | 2f7fe7aad6bb067ad9a9b523350612f7e1bd12b5 | |
parent | f56e7eb4dd3124d53a5200ff093bc6bcbae671e9 (diff) |
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>
-rw-r--r-- | drivers/net/wireless/rtlwifi/Kconfig | 5 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/debug.h | 34 |
2 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/wireless/rtlwifi/Kconfig b/drivers/net/wireless/rtlwifi/Kconfig index d6c42e69bdbd..44b9c0a57702 100644 --- a/drivers/net/wireless/rtlwifi/Kconfig +++ b/drivers/net/wireless/rtlwifi/Kconfig | |||
@@ -49,6 +49,11 @@ config RTLWIFI | |||
49 | depends on RTL8192CE || RTL8192CU || RTL8192SE || RTL8192DE | 49 | depends on RTL8192CE || RTL8192CU || RTL8192SE || RTL8192DE |
50 | default m | 50 | default m |
51 | 51 | ||
52 | config RTLWIFI_DEBUG | ||
53 | tristate "Additional debugging output" | ||
54 | depends on RTL8192CE || RTL8192CU || RTL8192SE || RTL8192DE | ||
55 | default y | ||
56 | |||
52 | config RTL8192C_COMMON | 57 | config RTL8192C_COMMON |
53 | tristate | 58 | tristate |
54 | depends on RTL8192CE || RTL8192CU | 59 | depends on RTL8192CE || RTL8192CU |
diff --git a/drivers/net/wireless/rtlwifi/debug.h b/drivers/net/wireless/rtlwifi/debug.h index b024c23b6523..fd5600c69428 100644 --- a/drivers/net/wireless/rtlwifi/debug.h +++ b/drivers/net/wireless/rtlwifi/debug.h | |||
@@ -156,6 +156,8 @@ enum dbgp_flag_e { | |||
156 | DBGP_TYPE_MAX | 156 | DBGP_TYPE_MAX |
157 | }; | 157 | }; |
158 | 158 | ||
159 | #ifdef CONFIG_RTLWIFI_DEBUG | ||
160 | |||
159 | #define RT_ASSERT(_exp, fmt, ...) \ | 161 | #define RT_ASSERT(_exp, fmt, ...) \ |
160 | do { \ | 162 | do { \ |
161 | if (!(_exp)) { \ | 163 | if (!(_exp)) { \ |
@@ -195,5 +197,37 @@ do { \ | |||
195 | } \ | 197 | } \ |
196 | } while (0) | 198 | } while (0) |
197 | 199 | ||
200 | #else | ||
201 | |||
202 | struct rtl_priv; | ||
203 | |||
204 | __printf(2, 3) | ||
205 | static inline void RT_ASSERT(int exp, const char *fmt, ...) | ||
206 | { | ||
207 | } | ||
208 | |||
209 | __printf(4, 5) | ||
210 | static inline void RT_TRACE(struct rtl_priv *rtlpriv, | ||
211 | int comp, int level, | ||
212 | const char *fmt, ...) | ||
213 | { | ||
214 | } | ||
215 | |||
216 | __printf(4, 5) | ||
217 | static inline void RTPRINT(struct rtl_priv *rtlpriv, | ||
218 | int dbgtype, int dbgflag, | ||
219 | const char *fmt, ...) | ||
220 | { | ||
221 | } | ||
222 | |||
223 | static inline void RT_PRINT_DATA(struct rtl_priv *rtlpriv, | ||
224 | int comp, int level, | ||
225 | const char *titlestring, | ||
226 | const void *hexdata, size_t hexdatalen) | ||
227 | { | ||
228 | } | ||
229 | |||
230 | #endif | ||
231 | |||
198 | void rtl_dbgp_flag_init(struct ieee80211_hw *hw); | 232 | void rtl_dbgp_flag_init(struct ieee80211_hw *hw); |
199 | #endif | 233 | #endif |