diff options
author | Joe Perches <joe@perches.com> | 2012-01-04 22:40:41 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-24 14:07:40 -0500 |
commit | f30d7507a8116e2099a9135c873411db8c0a3dc6 (patch) | |
tree | 14ff0954b36045e9dfce93a4f0dd0e40c04960a2 /drivers/net/wireless/rtlwifi/usb.c | |
parent | af08687b4e6d44dcdb04b519e718eb58ecb99050 (diff) |
rtlwifi: Convert RT_TRACE macro to use ##__VA_ARGS__
Consolidate printks to avoid possible message interleaving
and reduce the object size.
Remove unnecessary RT_TRACE parentheses.
Miscellaneous typo and grammar fixes.
Add missing newlines to formats.
Remove duplicate KERN_DEBUG prefixes.
Coalesce formats.
Align arguments.
$ size drivers/net/wireless/rtlwifi/built-in.o*
text data bss dec hex filename
594841 55333 129680 779854 be64e drivers/net/wireless/rtlwifi/built-in.o.new
607022 55333 138720 801075 c3933 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>
Diffstat (limited to 'drivers/net/wireless/rtlwifi/usb.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/usb.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index 1b8e68e70f8a..d670e6886c1f 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
@@ -276,14 +276,14 @@ static int _rtl_usb_init_tx(struct ieee80211_hw *hw) | |||
276 | ? USB_HIGH_SPEED_BULK_SIZE | 276 | ? USB_HIGH_SPEED_BULK_SIZE |
277 | : USB_FULL_SPEED_BULK_SIZE; | 277 | : USB_FULL_SPEED_BULK_SIZE; |
278 | 278 | ||
279 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("USB Max Bulk-out Size=%d\n", | 279 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "USB Max Bulk-out Size=%d\n", |
280 | rtlusb->max_bulk_out_size)); | 280 | rtlusb->max_bulk_out_size); |
281 | 281 | ||
282 | for (i = 0; i < __RTL_TXQ_NUM; i++) { | 282 | for (i = 0; i < __RTL_TXQ_NUM; i++) { |
283 | u32 ep_num = rtlusb->ep_map.ep_mapping[i]; | 283 | u32 ep_num = rtlusb->ep_map.ep_mapping[i]; |
284 | if (!ep_num) { | 284 | if (!ep_num) { |
285 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | 285 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
286 | ("Invalid endpoint map setting!\n")); | 286 | "Invalid endpoint map setting!\n"); |
287 | return -EINVAL; | 287 | return -EINVAL; |
288 | } | 288 | } |
289 | } | 289 | } |
@@ -345,9 +345,9 @@ static int _rtl_usb_init(struct ieee80211_hw *hw) | |||
345 | rtlusb->out_ep_nums++; | 345 | rtlusb->out_ep_nums++; |
346 | 346 | ||
347 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | 347 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
348 | ("USB EP(0x%02x), MaxPacketSize=%d ,Interval=%d.\n", | 348 | "USB EP(0x%02x), MaxPacketSize=%d, Interval=%d\n", |
349 | pep_desc->bEndpointAddress, pep_desc->wMaxPacketSize, | 349 | pep_desc->bEndpointAddress, pep_desc->wMaxPacketSize, |
350 | pep_desc->bInterval)); | 350 | pep_desc->bInterval); |
351 | } | 351 | } |
352 | if (rtlusb->in_ep_nums < rtlpriv->cfg->usb_interface_cfg->in_ep_num) | 352 | if (rtlusb->in_ep_nums < rtlpriv->cfg->usb_interface_cfg->in_ep_num) |
353 | return -EINVAL ; | 353 | return -EINVAL ; |
@@ -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 | ||
@@ -575,7 +575,7 @@ static void _rtl_rx_completed(struct urb *_urb) | |||
575 | if (IS_ERR(_skb)) { | 575 | if (IS_ERR(_skb)) { |
576 | err = PTR_ERR(_skb); | 576 | err = PTR_ERR(_skb); |
577 | RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, | 577 | RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, |
578 | ("Can't allocate skb for bulk IN!\n")); | 578 | "Can't allocate skb for bulk IN!\n"); |
579 | return; | 579 | return; |
580 | } | 580 | } |
581 | skb = _skb; | 581 | skb = _skb; |
@@ -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 | } |
@@ -745,7 +745,7 @@ static void _rtl_submit_tx_urb(struct ieee80211_hw *hw, struct urb *_urb) | |||
745 | struct sk_buff *skb; | 745 | struct sk_buff *skb; |
746 | 746 | ||
747 | RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, | 747 | RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, |
748 | ("Failed to submit urb.\n")); | 748 | "Failed to submit urb\n"); |
749 | usb_unanchor_urb(_urb); | 749 | usb_unanchor_urb(_urb); |
750 | skb = (struct sk_buff *)_urb->context; | 750 | skb = (struct sk_buff *)_urb->context; |
751 | kfree_skb(skb); | 751 | kfree_skb(skb); |
@@ -768,7 +768,7 @@ static int _usb_tx_post(struct ieee80211_hw *hw, struct urb *urb, | |||
768 | 768 | ||
769 | if (urb->status) { | 769 | if (urb->status) { |
770 | RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, | 770 | RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, |
771 | ("Urb has error status 0x%X\n", urb->status)); | 771 | "Urb has error status 0x%X\n", urb->status); |
772 | goto out; | 772 | goto out; |
773 | } | 773 | } |
774 | /* TODO: statistics */ | 774 | /* TODO: statistics */ |
@@ -805,7 +805,7 @@ static struct urb *_rtl_usb_tx_urb_setup(struct ieee80211_hw *hw, | |||
805 | _urb = usb_alloc_urb(0, GFP_ATOMIC); | 805 | _urb = usb_alloc_urb(0, GFP_ATOMIC); |
806 | if (!_urb) { | 806 | if (!_urb) { |
807 | RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, | 807 | RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, |
808 | ("Can't allocate URB for bulk out!\n")); | 808 | "Can't allocate URB for bulk out!\n"); |
809 | kfree_skb(skb); | 809 | kfree_skb(skb); |
810 | return NULL; | 810 | return NULL; |
811 | } | 811 | } |
@@ -830,7 +830,7 @@ static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
830 | WARN_ON(NULL == rtlusb->usb_tx_aggregate_hdl); | 830 | WARN_ON(NULL == rtlusb->usb_tx_aggregate_hdl); |
831 | if (unlikely(IS_USB_STOP(rtlusb))) { | 831 | if (unlikely(IS_USB_STOP(rtlusb))) { |
832 | RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, | 832 | RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, |
833 | ("USB device is stopping...\n")); | 833 | "USB device is stopping...\n"); |
834 | kfree_skb(skb); | 834 | kfree_skb(skb); |
835 | return; | 835 | return; |
836 | } | 836 | } |
@@ -840,7 +840,7 @@ static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
840 | _urb = _rtl_usb_tx_urb_setup(hw, _skb, ep_num); | 840 | _urb = _rtl_usb_tx_urb_setup(hw, _skb, ep_num); |
841 | if (unlikely(!_urb)) { | 841 | if (unlikely(!_urb)) { |
842 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 842 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
843 | ("Can't allocate urb. Drop skb!\n")); | 843 | "Can't allocate urb. Drop skb!\n"); |
844 | return; | 844 | return; |
845 | } | 845 | } |
846 | urb_list = &rtlusb->tx_pending[ep_num]; | 846 | urb_list = &rtlusb->tx_pending[ep_num]; |
@@ -865,7 +865,7 @@ static void _rtl_usb_tx_preprocess(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
865 | 865 | ||
866 | memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); | 866 | memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); |
867 | if (ieee80211_is_auth(fc)) { | 867 | if (ieee80211_is_auth(fc)) { |
868 | RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, ("MAC80211_LINKING\n")); | 868 | RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, "MAC80211_LINKING\n"); |
869 | rtl_ips_nic_on(hw); | 869 | rtl_ips_nic_on(hw); |
870 | } | 870 | } |
871 | 871 | ||
@@ -969,8 +969,7 @@ int __devinit rtl_usb_probe(struct usb_interface *intf, | |||
969 | /*like read eeprom and so on */ | 969 | /*like read eeprom and so on */ |
970 | rtlpriv->cfg->ops->read_eeprom_info(hw); | 970 | rtlpriv->cfg->ops->read_eeprom_info(hw); |
971 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { | 971 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { |
972 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 972 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); |
973 | ("Can't init_sw_vars.\n")); | ||
974 | goto error_out; | 973 | goto error_out; |
975 | } | 974 | } |
976 | rtlpriv->cfg->ops->init_sw_leds(hw); | 975 | rtlpriv->cfg->ops->init_sw_leds(hw); |
@@ -980,7 +979,7 @@ int __devinit rtl_usb_probe(struct usb_interface *intf, | |||
980 | err = rtl_init_core(hw); | 979 | err = rtl_init_core(hw); |
981 | if (err) { | 980 | if (err) { |
982 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 981 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
983 | ("Can't allocate sw for mac80211.\n")); | 982 | "Can't allocate sw for mac80211\n"); |
984 | goto error_out; | 983 | goto error_out; |
985 | } | 984 | } |
986 | 985 | ||
@@ -990,7 +989,7 @@ int __devinit rtl_usb_probe(struct usb_interface *intf, | |||
990 | err = ieee80211_register_hw(hw); | 989 | err = ieee80211_register_hw(hw); |
991 | if (err) { | 990 | if (err) { |
992 | RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, | 991 | RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, |
993 | ("Can't register mac80211 hw.\n")); | 992 | "Can't register mac80211 hw\n"); |
994 | goto error_out; | 993 | goto error_out; |
995 | } else { | 994 | } else { |
996 | rtlpriv->mac80211.mac80211_registered = 1; | 995 | rtlpriv->mac80211.mac80211_registered = 1; |