aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtlwifi/debug.h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-01-04 22:40:39 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-01-24 14:06:06 -0500
commit884dd24499df823f5c167223c7ae93bd764e2e4f (patch)
tree6a4b8c610b4b3644d868ebb758d89e1387e3ecad /drivers/net/wireless/rtlwifi/debug.h
parent3084f3b65c178228bece6f7b166a19f3e38a75d4 (diff)
rtlwifi: Neaten RT_ASSERT, RT_TRACE, RTPRINT, RT_PRINT_DATA macros
Make the macros a bit more readable. Use do {...} while (0) without terminating semicolons. Add missing terminating semicolon to a few uses. 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>
Diffstat (limited to 'drivers/net/wireless/rtlwifi/debug.h')
-rw-r--r--drivers/net/wireless/rtlwifi/debug.h88
1 files changed, 41 insertions, 47 deletions
diff --git a/drivers/net/wireless/rtlwifi/debug.h b/drivers/net/wireless/rtlwifi/debug.h
index 160dd0685213..802c491b3d86 100644
--- a/drivers/net/wireless/rtlwifi/debug.h
+++ b/drivers/net/wireless/rtlwifi/debug.h
@@ -156,53 +156,47 @@ enum dbgp_flag_e {
156 DBGP_TYPE_MAX 156 DBGP_TYPE_MAX
157}; 157};
158 158
159#define RT_ASSERT(_exp, fmt) \ 159#define RT_ASSERT(_exp, fmt) \
160 do { \ 160do { \
161 if (!(_exp)) { \ 161 if (!(_exp)) { \
162 printk(KERN_DEBUG "%s:%s(): ", KBUILD_MODNAME, \ 162 printk(KERN_DEBUG "%s:%s(): ", \
163 __func__); \ 163 KBUILD_MODNAME, __func__); \
164 printk fmt; \ 164 printk fmt; \
165 } \ 165 } \
166 } while (0); 166} while (0)
167 167
168#define RT_TRACE(rtlpriv, comp, level, fmt)\ 168#define RT_TRACE(rtlpriv, comp, level, fmt) \
169 do { \ 169do { \
170 if (unlikely(((comp) & rtlpriv->dbg.global_debugcomponents) && \ 170 if (unlikely(((comp) & rtlpriv->dbg.global_debugcomponents) && \
171 ((level) <= rtlpriv->dbg.global_debuglevel))) {\ 171 ((level) <= rtlpriv->dbg.global_debuglevel))) { \
172 printk(KERN_DEBUG "%s:%s():<%lx-%x> ", KBUILD_MODNAME, \ 172 printk(KERN_DEBUG "%s:%s():<%lx-%x> ", \
173 __func__, in_interrupt(), in_atomic()); \ 173 KBUILD_MODNAME, __func__, \
174 printk fmt; \ 174 in_interrupt(), in_atomic()); \
175 } \ 175 printk fmt; \
176 } while (0); 176 } \
177 177} while (0)
178#define RTPRINT(rtlpriv, dbgtype, dbgflag, printstr) \ 178
179 do { \ 179#define RTPRINT(rtlpriv, dbgtype, dbgflag, printstr) \
180 if (unlikely(rtlpriv->dbg.dbgp_type[dbgtype] & dbgflag)) { \ 180do { \
181 printk(KERN_DEBUG "%s: ", KBUILD_MODNAME); \ 181 if (unlikely(rtlpriv->dbg.dbgp_type[dbgtype] & dbgflag)) { \
182 printk printstr; \ 182 printk(KERN_DEBUG "%s: ", KBUILD_MODNAME); \
183 } \ 183 printk printstr; \
184 } while (0); 184 } \
185 185} while (0)
186#define RT_PRINT_DATA(rtlpriv, _comp, _level, _titlestring, _hexdata, \ 186
187 _hexdatalen) \ 187#define RT_PRINT_DATA(rtlpriv, _comp, _level, _titlestring, _hexdata, \
188 do {\ 188 _hexdatalen) \
189 if (unlikely(((_comp) & rtlpriv->dbg.global_debugcomponents) &&\ 189do { \
190 (_level <= rtlpriv->dbg.global_debuglevel))) { \ 190 if (unlikely(((_comp) & rtlpriv->dbg.global_debugcomponents) && \
191 int __i; \ 191 (_level <= rtlpriv->dbg.global_debuglevel))) { \
192 u8* ptr = (u8 *)_hexdata; \ 192 printk(KERN_DEBUG "%s: ", KBUILD_MODNAME); \
193 printk(KERN_DEBUG "%s: ", KBUILD_MODNAME); \ 193 pr_cont("In process \"%s\" (pid %i):", \
194 printk("In process \"%s\" (pid %i):", current->comm,\ 194 current->comm, current->pid); \
195 current->pid); \ 195 printk(_titlestring); \
196 printk(_titlestring); \ 196 print_hex_dump_bytes("", DUMP_PREFIX_NONE, \
197 for (__i = 0; __i < (int)_hexdatalen; __i++) { \ 197 _hexdata, _hexdatalen); \
198 printk("%02X%s", ptr[__i], (((__i + 1) % 4)\ 198 } \
199 == 0) ? " " : " ");\ 199} while (0)
200 if (((__i + 1) % 16) == 0) \
201 printk("\n"); \
202 } \
203 printk(KERN_DEBUG "\n"); \
204 } \
205 } while (0);
206 200
207void rtl_dbgp_flag_init(struct ieee80211_hw *hw); 201void rtl_dbgp_flag_init(struct ieee80211_hw *hw);
208#endif 202#endif