aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtlwifi
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2013-09-25 13:57:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-10-03 16:24:29 -0400
commit354d0f3c40fb40193213e40f3177ff528798ca8d (patch)
treec7282a68c564af52b84be469bd297543bc613e26 /drivers/net/wireless/rtlwifi
parenta3557d4d485322ebc60ca7f11616695c5dd69383 (diff)
rtlwifi: Fix smatch warnings in usb.c
Smatch displays the following: CHECK drivers/net/wireless/rtlwifi/usb.c drivers/net/wireless/rtlwifi/usb.c:458 _rtl_usb_rx_process_agg() warn: assigning (-98) to unsigned variable 'stats.noise' drivers/net/wireless/rtlwifi/usb.c:503 _rtl_usb_rx_process_noagg() warn: assigning (-98) to unsigned variable 'stats.noise' drivers/net/wireless/rtlwifi/usb.c:596 _rtl_rx_get_padding() info: ignoring unreachable code. drivers/net/wireless/rtlwifi/usb.c:596 _rtl_rx_get_padding() info: ignoring unreachable code. The variable 'stats.noise' is not used, thus the initializers are removed. The unreachable code info is fixed by including the appropriate section inside #ifdef .. #endif constructions. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtlwifi')
-rw-r--r--drivers/net/wireless/rtlwifi/usb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index e56778cac9bf..6e2b5c5c83c8 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -455,7 +455,6 @@ static void _rtl_usb_rx_process_agg(struct ieee80211_hw *hw,
455 struct ieee80211_rx_status rx_status = {0}; 455 struct ieee80211_rx_status rx_status = {0};
456 struct rtl_stats stats = { 456 struct rtl_stats stats = {
457 .signal = 0, 457 .signal = 0,
458 .noise = -98,
459 .rate = 0, 458 .rate = 0,
460 }; 459 };
461 460
@@ -498,7 +497,6 @@ static void _rtl_usb_rx_process_noagg(struct ieee80211_hw *hw,
498 struct ieee80211_rx_status rx_status = {0}; 497 struct ieee80211_rx_status rx_status = {0};
499 struct rtl_stats stats = { 498 struct rtl_stats stats = {
500 .signal = 0, 499 .signal = 0,
501 .noise = -98,
502 .rate = 0, 500 .rate = 0,
503 }; 501 };
504 502
@@ -582,12 +580,15 @@ static void _rtl_rx_work(unsigned long param)
582static unsigned int _rtl_rx_get_padding(struct ieee80211_hdr *hdr, 580static unsigned int _rtl_rx_get_padding(struct ieee80211_hdr *hdr,
583 unsigned int len) 581 unsigned int len)
584{ 582{
583#if NET_IP_ALIGN != 0
585 unsigned int padding = 0; 584 unsigned int padding = 0;
585#endif
586 586
587 /* make function no-op when possible */ 587 /* make function no-op when possible */
588 if (NET_IP_ALIGN == 0 || len < sizeof(*hdr)) 588 if (NET_IP_ALIGN == 0 || len < sizeof(*hdr))
589 return 0; 589 return 0;
590 590
591#if NET_IP_ALIGN != 0
591 /* alignment calculation as in lbtf_rx() / carl9170_rx_copy_data() */ 592 /* alignment calculation as in lbtf_rx() / carl9170_rx_copy_data() */
592 /* TODO: deduplicate common code, define helper function instead? */ 593 /* TODO: deduplicate common code, define helper function instead? */
593 594
@@ -608,6 +609,7 @@ static unsigned int _rtl_rx_get_padding(struct ieee80211_hdr *hdr,
608 padding ^= NET_IP_ALIGN; 609 padding ^= NET_IP_ALIGN;
609 610
610 return padding; 611 return padding;
612#endif
611} 613}
612 614
613#define __RADIO_TAP_SIZE_RSV 32 615#define __RADIO_TAP_SIZE_RSV 32