diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2012-08-31 16:39:00 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-09-07 15:05:57 -0400 |
commit | 8e2c406a5bd3923995f298f32eef25d5c2bcd4a8 (patch) | |
tree | bee3fd77e4c4207ef4fc36ab522c439b53a02fba | |
parent | 229bd9df49cf772b0540ea13d64e8ca1bfcc6b48 (diff) |
rtlwifi: rtl8192c: rtl8192ce: rtl8192cu: rtl8192se: Remove sparse warnings
The rtlwifi family of drivers has the following sparse errors:
CHECK drivers/net/wireless/rtlwifi/usb.c
drivers/net/wireless/rtlwifi/usb.c:122:17: warning: cast to restricted __le32
CHECK drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:1157:13: warning: context imbalance in 'rtl92c_dm_refresh_rate_adaptive_mask' - different lock contexts for basic block
CHECK drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
drivers/net/wireless/rtlwifi/rtl8192ce/hw.c:1909:30: warning: cast to restricted __le32
CHECK drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c:345:1: warning: symbol 'rtl92ce_pci_ids' was not declared. Should it be static?
CHECK drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
drivers/net/wireless/rtlwifi/rtl8192cu/trx.c:494:9: warning: cast from restricted __le16
CHECK drivers/net/wireless/rtlwifi/rtl8192se/fw.c
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:490:17: warning: cast to restricted __le32
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:490:17: warning: cast to restricted __le32
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:494:17: warning: cast to restricted __le32
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:494:17: warning: cast to restricted __le32
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:499:17: warning: cast to restricted __le32
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:499:17: warning: cast to restricted __le32
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:510:25: warning: cast to restricted __le32
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:510:25: warning: cast to restricted __le32
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:607:9: warning: cast to restricted __le16
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:607:9: warning: cast to restricted __le16
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:650:9: warning: cast to restricted __le16
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:650:9: warning: cast to restricted __le16
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:652:9: warning: cast to restricted __le16
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:652:9: warning: cast to restricted __le16
CHECK drivers/net/wireless/rtlwifi/rtl8192se/trx.c
drivers/net/wireless/rtlwifi/rtl8192se/trx.c:758:9: warning: cast from restricted __le32
drivers/net/wireless/rtlwifi/rtl8192se/trx.c:788:17: warning: cast from restricted __le32
drivers/net/wireless/rtlwifi/rtl8192se/trx.c:804:17: warning: cast to restricted __le32
drivers/net/wireless/rtlwifi/rtl8192se/trx.c:804:17: warning: cast to restricted __le32
drivers/net/wireless/rtlwifi/rtl8192se/trx.c:807:17: warning: cast from restricted __le32
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192se/trx.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/usb.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/wifi.h | 14 |
7 files changed, 18 insertions, 23 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c index 2fd3b4950404..1ca4e25c143b 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c +++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | |||
@@ -1214,18 +1214,13 @@ static void rtl92c_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw) | |||
1214 | "PreState = %d, CurState = %d\n", | 1214 | "PreState = %d, CurState = %d\n", |
1215 | p_ra->pre_ratr_state, p_ra->ratr_state); | 1215 | p_ra->pre_ratr_state, p_ra->ratr_state); |
1216 | 1216 | ||
1217 | /* Only the PCI card uses sta in the update rate table | 1217 | rcu_read_lock(); |
1218 | * callback routine */ | 1218 | sta = ieee80211_find_sta(mac->vif, mac->bssid); |
1219 | if (rtlhal->interface == INTF_PCI) { | ||
1220 | rcu_read_lock(); | ||
1221 | sta = ieee80211_find_sta(mac->vif, mac->bssid); | ||
1222 | } | ||
1223 | rtlpriv->cfg->ops->update_rate_tbl(hw, sta, | 1219 | rtlpriv->cfg->ops->update_rate_tbl(hw, sta, |
1224 | p_ra->ratr_state); | 1220 | p_ra->ratr_state); |
1225 | 1221 | ||
1226 | p_ra->pre_ratr_state = p_ra->ratr_state; | 1222 | p_ra->pre_ratr_state = p_ra->ratr_state; |
1227 | if (rtlhal->interface == INTF_PCI) | 1223 | rcu_read_unlock(); |
1228 | rcu_read_unlock(); | ||
1229 | } | 1224 | } |
1230 | } | 1225 | } |
1231 | } | 1226 | } |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c index bd0da7ef290b..cc895828c0ea 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | |||
@@ -1906,8 +1906,8 @@ static void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, | |||
1906 | } | 1906 | } |
1907 | RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, | 1907 | RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, |
1908 | "ratr_bitmap :%x\n", ratr_bitmap); | 1908 | "ratr_bitmap :%x\n", ratr_bitmap); |
1909 | *(u32 *)&rate_mask = EF4BYTE((ratr_bitmap & 0x0fffffff) | | 1909 | *(u32 *)&rate_mask = (ratr_bitmap & 0x0fffffff) | |
1910 | (ratr_index << 28)); | 1910 | (ratr_index << 28); |
1911 | rate_mask[4] = macid | (shortgi ? 0x20 : 0x00) | 0x80; | 1911 | rate_mask[4] = macid | (shortgi ? 0x20 : 0x00) | 0x80; |
1912 | RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, | 1912 | RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, |
1913 | "Rate_index:%x, ratr_val:%x, %x:%x:%x:%x:%x\n", | 1913 | "Rate_index:%x, ratr_val:%x, %x:%x:%x:%x:%x\n", |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c index 3aa927f8b9b9..60451eea4d82 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | |||
@@ -342,7 +342,7 @@ static struct rtl_hal_cfg rtl92ce_hal_cfg = { | |||
342 | .maps[RTL_RC_HT_RATEMCS15] = DESC92_RATEMCS15, | 342 | .maps[RTL_RC_HT_RATEMCS15] = DESC92_RATEMCS15, |
343 | }; | 343 | }; |
344 | 344 | ||
345 | DEFINE_PCI_DEVICE_TABLE(rtl92ce_pci_ids) = { | 345 | static DEFINE_PCI_DEVICE_TABLE(rtl92ce_pci_ids) = { |
346 | {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8191, rtl92ce_hal_cfg)}, | 346 | {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8191, rtl92ce_hal_cfg)}, |
347 | {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8178, rtl92ce_hal_cfg)}, | 347 | {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8178, rtl92ce_hal_cfg)}, |
348 | {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8177, rtl92ce_hal_cfg)}, | 348 | {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8177, rtl92ce_hal_cfg)}, |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c index 27863d773790..6e66f04c363f 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | |||
@@ -491,7 +491,7 @@ static void _rtl_tx_desc_checksum(u8 *txdesc) | |||
491 | SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, 0); | 491 | SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, 0); |
492 | for (index = 0; index < 16; index++) | 492 | for (index = 0; index < 16; index++) |
493 | checksum = checksum ^ (*(ptr + index)); | 493 | checksum = checksum ^ (*(ptr + index)); |
494 | SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, cpu_to_le16(checksum)); | 494 | SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, checksum); |
495 | } | 495 | } |
496 | 496 | ||
497 | void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, | 497 | void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c index 28c53fb12aeb..e3cf4c02122a 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c | |||
@@ -756,7 +756,7 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw, | |||
756 | SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16) skb->len); | 756 | SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16) skb->len); |
757 | 757 | ||
758 | /* DOWRD 8 */ | 758 | /* DOWRD 8 */ |
759 | SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping)); | 759 | SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping); |
760 | 760 | ||
761 | RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "\n"); | 761 | RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "\n"); |
762 | } | 762 | } |
@@ -786,7 +786,7 @@ void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc, | |||
786 | /* 92SE need not to set TX packet size when firmware download */ | 786 | /* 92SE need not to set TX packet size when firmware download */ |
787 | SET_TX_DESC_PKT_SIZE(pdesc, (u16)(skb->len)); | 787 | SET_TX_DESC_PKT_SIZE(pdesc, (u16)(skb->len)); |
788 | SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len)); | 788 | SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len)); |
789 | SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping)); | 789 | SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping); |
790 | 790 | ||
791 | wmb(); | 791 | wmb(); |
792 | SET_TX_DESC_OWN(pdesc, 1); | 792 | SET_TX_DESC_OWN(pdesc, 1); |
@@ -805,7 +805,7 @@ void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc, | |||
805 | SET_BITS_TO_LE_4BYTE(skb->data, 24, 7, rtlhal->h2c_txcmd_seq); | 805 | SET_BITS_TO_LE_4BYTE(skb->data, 24, 7, rtlhal->h2c_txcmd_seq); |
806 | 806 | ||
807 | SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len)); | 807 | SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len)); |
808 | SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping)); | 808 | SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping); |
809 | 809 | ||
810 | wmb(); | 810 | wmb(); |
811 | SET_TX_DESC_OWN(pdesc, 1); | 811 | SET_TX_DESC_OWN(pdesc, 1); |
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index 914046903cfd..030beb45d8b0 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
@@ -120,7 +120,7 @@ static int _usbctrl_vendorreq_sync_read(struct usb_device *udev, u8 request, | |||
120 | 120 | ||
121 | if (status < 0 && count++ < 4) | 121 | if (status < 0 && count++ < 4) |
122 | pr_err("reg 0x%x, usbctrl_vendorreq TimeOut! status:0x%x value=0x%x\n", | 122 | pr_err("reg 0x%x, usbctrl_vendorreq TimeOut! status:0x%x value=0x%x\n", |
123 | value, status, le32_to_cpu(*(u32 *)pdata)); | 123 | value, status, *(u32 *)pdata); |
124 | return status; | 124 | return status; |
125 | } | 125 | } |
126 | 126 | ||
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h index a15c11280980..d4bc7859cded 100644 --- a/drivers/net/wireless/rtlwifi/wifi.h +++ b/drivers/net/wireless/rtlwifi/wifi.h | |||
@@ -1820,9 +1820,9 @@ struct bt_coexist_info { | |||
1820 | EF1BYTE(*((u8 *)(_ptr))) | 1820 | EF1BYTE(*((u8 *)(_ptr))) |
1821 | /* Read le16 data from memory and convert to host ordering */ | 1821 | /* Read le16 data from memory and convert to host ordering */ |
1822 | #define READEF2BYTE(_ptr) \ | 1822 | #define READEF2BYTE(_ptr) \ |
1823 | EF2BYTE(*((u16 *)(_ptr))) | 1823 | EF2BYTE(*(_ptr)) |
1824 | #define READEF4BYTE(_ptr) \ | 1824 | #define READEF4BYTE(_ptr) \ |
1825 | EF4BYTE(*((u32 *)(_ptr))) | 1825 | EF4BYTE(*(_ptr)) |
1826 | 1826 | ||
1827 | /* Write data to memory */ | 1827 | /* Write data to memory */ |
1828 | #define WRITEEF1BYTE(_ptr, _val) \ | 1828 | #define WRITEEF1BYTE(_ptr, _val) \ |
@@ -1831,7 +1831,7 @@ struct bt_coexist_info { | |||
1831 | #define WRITEEF2BYTE(_ptr, _val) \ | 1831 | #define WRITEEF2BYTE(_ptr, _val) \ |
1832 | (*((u16 *)(_ptr))) = EF2BYTE(_val) | 1832 | (*((u16 *)(_ptr))) = EF2BYTE(_val) |
1833 | #define WRITEEF4BYTE(_ptr, _val) \ | 1833 | #define WRITEEF4BYTE(_ptr, _val) \ |
1834 | (*((u16 *)(_ptr))) = EF2BYTE(_val) | 1834 | (*((u32 *)(_ptr))) = EF2BYTE(_val) |
1835 | 1835 | ||
1836 | /* Create a bit mask | 1836 | /* Create a bit mask |
1837 | * Examples: | 1837 | * Examples: |
@@ -1864,9 +1864,9 @@ struct bt_coexist_info { | |||
1864 | * 4-byte pointer in little-endian system. | 1864 | * 4-byte pointer in little-endian system. |
1865 | */ | 1865 | */ |
1866 | #define LE_P4BYTE_TO_HOST_4BYTE(__pstart) \ | 1866 | #define LE_P4BYTE_TO_HOST_4BYTE(__pstart) \ |
1867 | (EF4BYTE(*((u32 *)(__pstart)))) | 1867 | (EF4BYTE(*((__le32 *)(__pstart)))) |
1868 | #define LE_P2BYTE_TO_HOST_2BYTE(__pstart) \ | 1868 | #define LE_P2BYTE_TO_HOST_2BYTE(__pstart) \ |
1869 | (EF2BYTE(*((u16 *)(__pstart)))) | 1869 | (EF2BYTE(*((__le16 *)(__pstart)))) |
1870 | #define LE_P1BYTE_TO_HOST_1BYTE(__pstart) \ | 1870 | #define LE_P1BYTE_TO_HOST_1BYTE(__pstart) \ |
1871 | (EF1BYTE(*((u8 *)(__pstart)))) | 1871 | (EF1BYTE(*((u8 *)(__pstart)))) |
1872 | 1872 | ||
@@ -1913,13 +1913,13 @@ value to host byte ordering.*/ | |||
1913 | * Set subfield of little-endian 4-byte value to specified value. | 1913 | * Set subfield of little-endian 4-byte value to specified value. |
1914 | */ | 1914 | */ |
1915 | #define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \ | 1915 | #define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \ |
1916 | *((u32 *)(__pstart)) = EF4BYTE \ | 1916 | *((u32 *)(__pstart)) = \ |
1917 | ( \ | 1917 | ( \ |
1918 | LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \ | 1918 | LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \ |
1919 | ((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \ | 1919 | ((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \ |
1920 | ); | 1920 | ); |
1921 | #define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \ | 1921 | #define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \ |
1922 | *((u16 *)(__pstart)) = EF2BYTE \ | 1922 | *((u16 *)(__pstart)) = \ |
1923 | ( \ | 1923 | ( \ |
1924 | LE_BITS_CLEARED_TO_2BYTE(__pstart, __bitoffset, __bitlen) | \ | 1924 | LE_BITS_CLEARED_TO_2BYTE(__pstart, __bitoffset, __bitlen) | \ |
1925 | ((((u16)__val) & BIT_LEN_MASK_16(__bitlen)) << (__bitoffset)) \ | 1925 | ((((u16)__val) & BIT_LEN_MASK_16(__bitlen)) << (__bitoffset)) \ |