aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
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')
-rw-r--r--drivers/net/wireless/rtlwifi/debug.h88
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/phy.c2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/phy.c2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/hw.c2
-rw-r--r--drivers/net/wireless/rtlwifi/usb.c6
5 files changed, 47 insertions, 53 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
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c b/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c
index 3b585aadabfc..ce9eea94bb53 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c
@@ -374,7 +374,7 @@ void rtl92ce_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
374 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, 374 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE,
375 ("Switch to %s bandwidth\n", 375 ("Switch to %s bandwidth\n",
376 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ? 376 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ?
377 "20MHz" : "40MHz")) 377 "20MHz" : "40MHz"));
378 378
379 if (is_hal_stop(rtlhal)) { 379 if (is_hal_stop(rtlhal)) {
380 rtlphy->set_bwmode_inprogress = false; 380 rtlphy->set_bwmode_inprogress = false;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c b/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c
index e49cf2244c75..df491d38eccc 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c
@@ -360,7 +360,7 @@ void rtl92cu_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
360 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, 360 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE,
361 ("Switch to %s bandwidth\n", 361 ("Switch to %s bandwidth\n",
362 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ? 362 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ?
363 "20MHz" : "40MHz")) 363 "20MHz" : "40MHz"));
364 if (is_hal_stop(rtlhal)) { 364 if (is_hal_stop(rtlhal)) {
365 rtlphy->set_bwmode_inprogress = false; 365 rtlphy->set_bwmode_inprogress = false;
366 return; 366 return;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
index 9d89d7ccdafb..c8c4cf9240d3 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
@@ -1617,7 +1617,7 @@ static void _rtl92de_read_txpower_info(struct ieee80211_hw *hw,
1617 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1617 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
1618 ("Is D cut,Internal PA0 %d Internal PA1 %d\n", 1618 ("Is D cut,Internal PA0 %d Internal PA1 %d\n",
1619 rtlefuse->internal_pa_5g[0], 1619 rtlefuse->internal_pa_5g[0],
1620 rtlefuse->internal_pa_5g[1])) 1620 rtlefuse->internal_pa_5g[1]));
1621 } 1621 }
1622 rtlefuse->eeprom_c9 = hwinfo[EEPROM_RF_OPT6]; 1622 rtlefuse->eeprom_c9 = hwinfo[EEPROM_RF_OPT6];
1623 rtlefuse->eeprom_cc = hwinfo[EEPROM_RF_OPT7]; 1623 rtlefuse->eeprom_cc = hwinfo[EEPROM_RF_OPT7];
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index e956fa71d040..1b8e68e70f8a 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -414,7 +414,7 @@ static struct sk_buff *_rtl_prep_rx_urb(struct ieee80211_hw *hw,
414 gfp_mask); 414 gfp_mask);
415 if (!skb) { 415 if (!skb) {
416 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, 416 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
417 ("Failed to __dev_alloc_skb!!\n")) 417 ("Failed to __dev_alloc_skb!!\n"));
418 return ERR_PTR(-ENOMEM); 418 return ERR_PTR(-ENOMEM);
419 } 419 }
420 420
@@ -632,14 +632,14 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw)
632 urb = usb_alloc_urb(0, GFP_KERNEL); 632 urb = usb_alloc_urb(0, GFP_KERNEL);
633 if (!urb) { 633 if (!urb) {
634 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, 634 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
635 ("Failed to alloc URB!!\n")) 635 ("Failed to alloc URB!!\n"));
636 goto err_out; 636 goto err_out;
637 } 637 }
638 638
639 skb = _rtl_prep_rx_urb(hw, rtlusb, urb, GFP_KERNEL); 639 skb = _rtl_prep_rx_urb(hw, rtlusb, urb, GFP_KERNEL);
640 if (IS_ERR(skb)) { 640 if (IS_ERR(skb)) {
641 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, 641 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
642 ("Failed to prep_rx_urb!!\n")) 642 ("Failed to prep_rx_urb!!\n"));
643 err = PTR_ERR(skb); 643 err = PTR_ERR(skb);
644 goto err_out; 644 goto err_out;
645 } 645 }