diff options
author | John W. Linville <linville@tuxdriver.com> | 2010-07-20 13:55:00 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-20 16:49:42 -0400 |
commit | b603742f49c3ec922522602e18ac22e8f6835132 (patch) | |
tree | b98a981bfdbe1145b94e23cfa192ec6f82d9074c | |
parent | 34782e9e1e58810183f2c1201124e45314b37130 (diff) |
mwl8k: correct/silence sparse warnings
drivers/net/wireless/mwl8k.c:1541:21: warning: incorrect type in assignment (different base types)
drivers/net/wireless/mwl8k.c:1541:21: expected restricted __le16 [usertype] result
drivers/net/wireless/mwl8k.c:1541:21: got int
drivers/net/wireless/mwl8k.c:1575:42: expected unsigned short [unsigned] [usertype] cmd
drivers/net/wireless/mwl8k.c:1575:42: got restricted __le16 [usertype] code
drivers/net/wireless/mwl8k.c:1587:50: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1587:50: expected unsigned short [unsigned] [usertype] cmd
drivers/net/wireless/mwl8k.c:1587:50: got restricted __le16 [usertype] code
drivers/net/wireless/mwl8k.c:1592:50: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1592:50: expected unsigned short [unsigned] [usertype] cmd
drivers/net/wireless/mwl8k.c:1592:50: got restricted __le16 [usertype] code
drivers/net/wireless/mwl8k.c:1845:27: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1845:27: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/wireless/mwl8k.c:1845:27: got restricted __le32 [usertype] <noident>
drivers/net/wireless/mwl8k.c:1848:27: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1848:27: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/wireless/mwl8k.c:1848:27: got restricted __le32 [usertype] <noident>
drivers/net/wireless/mwl8k.c:1851:27: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1851:27: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/wireless/mwl8k.c:1851:27: got restricted __le32 [usertype] <noident>
drivers/net/wireless/mwl8k.c:1854:27: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1854:27: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/wireless/mwl8k.c:1854:27: got restricted __le32 [usertype] <noident>
drivers/net/wireless/mwl8k.c:1857:27: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1857:27: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/wireless/mwl8k.c:1857:27: got restricted __le32 [usertype] <noident>
drivers/net/wireless/mwl8k.c:1860:27: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1860:27: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/wireless/mwl8k.c:1860:27: got restricted __le32 [usertype] <noident>
drivers/net/wireless/mwl8k.c:3055:20: warning: incorrect type in assignment (different base types)
drivers/net/wireless/mwl8k.c:3055:20: expected restricted __le16 [usertype] ht_caps
drivers/net/wireless/mwl8k.c:3055:20: got unsigned short [unsigned] [usertype] cap
At least the last one looks like a real bug...
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index cd37b2ac5356..e3f130c4eaff 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -314,13 +314,15 @@ static const struct ieee80211_rate mwl8k_rates_50[] = { | |||
314 | #define MWL8K_CMD_SET_NEW_STN 0x1111 /* per-vif */ | 314 | #define MWL8K_CMD_SET_NEW_STN 0x1111 /* per-vif */ |
315 | #define MWL8K_CMD_UPDATE_STADB 0x1123 | 315 | #define MWL8K_CMD_UPDATE_STADB 0x1123 |
316 | 316 | ||
317 | static const char *mwl8k_cmd_name(u16 cmd, char *buf, int bufsize) | 317 | static const char *mwl8k_cmd_name(__le16 cmd, char *buf, int bufsize) |
318 | { | 318 | { |
319 | u16 command = le16_to_cpu(cmd); | ||
320 | |||
319 | #define MWL8K_CMDNAME(x) case MWL8K_CMD_##x: do {\ | 321 | #define MWL8K_CMDNAME(x) case MWL8K_CMD_##x: do {\ |
320 | snprintf(buf, bufsize, "%s", #x);\ | 322 | snprintf(buf, bufsize, "%s", #x);\ |
321 | return buf;\ | 323 | return buf;\ |
322 | } while (0) | 324 | } while (0) |
323 | switch (cmd & ~0x8000) { | 325 | switch (command & ~0x8000) { |
324 | MWL8K_CMDNAME(CODE_DNLD); | 326 | MWL8K_CMDNAME(CODE_DNLD); |
325 | MWL8K_CMDNAME(GET_HW_SPEC); | 327 | MWL8K_CMDNAME(GET_HW_SPEC); |
326 | MWL8K_CMDNAME(SET_HW_SPEC); | 328 | MWL8K_CMDNAME(SET_HW_SPEC); |
@@ -1538,7 +1540,7 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd) | |||
1538 | unsigned long timeout = 0; | 1540 | unsigned long timeout = 0; |
1539 | u8 buf[32]; | 1541 | u8 buf[32]; |
1540 | 1542 | ||
1541 | cmd->result = 0xffff; | 1543 | cmd->result = (__force __le16) 0xffff; |
1542 | dma_size = le16_to_cpu(cmd->length); | 1544 | dma_size = le16_to_cpu(cmd->length); |
1543 | dma_addr = pci_map_single(priv->pdev, cmd, dma_size, | 1545 | dma_addr = pci_map_single(priv->pdev, cmd, dma_size, |
1544 | PCI_DMA_BIDIRECTIONAL); | 1546 | PCI_DMA_BIDIRECTIONAL); |
@@ -1842,22 +1844,22 @@ static int mwl8k_cmd_get_hw_spec_ap(struct ieee80211_hw *hw) | |||
1842 | priv->sta_macids_supported = 0x00000000; | 1844 | priv->sta_macids_supported = 0x00000000; |
1843 | 1845 | ||
1844 | off = le32_to_cpu(cmd->wcbbase0) & 0xffff; | 1846 | off = le32_to_cpu(cmd->wcbbase0) & 0xffff; |
1845 | iowrite32(cpu_to_le32(priv->txq[0].txd_dma), priv->sram + off); | 1847 | iowrite32(priv->txq[0].txd_dma, priv->sram + off); |
1846 | 1848 | ||
1847 | off = le32_to_cpu(cmd->rxwrptr) & 0xffff; | 1849 | off = le32_to_cpu(cmd->rxwrptr) & 0xffff; |
1848 | iowrite32(cpu_to_le32(priv->rxq[0].rxd_dma), priv->sram + off); | 1850 | iowrite32(priv->rxq[0].rxd_dma, priv->sram + off); |
1849 | 1851 | ||
1850 | off = le32_to_cpu(cmd->rxrdptr) & 0xffff; | 1852 | off = le32_to_cpu(cmd->rxrdptr) & 0xffff; |
1851 | iowrite32(cpu_to_le32(priv->rxq[0].rxd_dma), priv->sram + off); | 1853 | iowrite32(priv->rxq[0].rxd_dma, priv->sram + off); |
1852 | 1854 | ||
1853 | off = le32_to_cpu(cmd->wcbbase1) & 0xffff; | 1855 | off = le32_to_cpu(cmd->wcbbase1) & 0xffff; |
1854 | iowrite32(cpu_to_le32(priv->txq[1].txd_dma), priv->sram + off); | 1856 | iowrite32(priv->txq[1].txd_dma, priv->sram + off); |
1855 | 1857 | ||
1856 | off = le32_to_cpu(cmd->wcbbase2) & 0xffff; | 1858 | off = le32_to_cpu(cmd->wcbbase2) & 0xffff; |
1857 | iowrite32(cpu_to_le32(priv->txq[2].txd_dma), priv->sram + off); | 1859 | iowrite32(priv->txq[2].txd_dma, priv->sram + off); |
1858 | 1860 | ||
1859 | off = le32_to_cpu(cmd->wcbbase3) & 0xffff; | 1861 | off = le32_to_cpu(cmd->wcbbase3) & 0xffff; |
1860 | iowrite32(cpu_to_le32(priv->txq[3].txd_dma), priv->sram + off); | 1862 | iowrite32(priv->txq[3].txd_dma, priv->sram + off); |
1861 | } | 1863 | } |
1862 | 1864 | ||
1863 | kfree(cmd); | 1865 | kfree(cmd); |
@@ -3052,7 +3054,7 @@ static int mwl8k_cmd_update_stadb_add(struct ieee80211_hw *hw, | |||
3052 | p->peer_type = MWL8K_PEER_TYPE_ACCESSPOINT; | 3054 | p->peer_type = MWL8K_PEER_TYPE_ACCESSPOINT; |
3053 | p->basic_caps = cpu_to_le16(vif->bss_conf.assoc_capability); | 3055 | p->basic_caps = cpu_to_le16(vif->bss_conf.assoc_capability); |
3054 | p->ht_support = sta->ht_cap.ht_supported; | 3056 | p->ht_support = sta->ht_cap.ht_supported; |
3055 | p->ht_caps = sta->ht_cap.cap; | 3057 | p->ht_caps = cpu_to_le16(sta->ht_cap.cap); |
3056 | p->extended_ht_caps = (sta->ht_cap.ampdu_factor & 3) | | 3058 | p->extended_ht_caps = (sta->ht_cap.ampdu_factor & 3) | |
3057 | ((sta->ht_cap.ampdu_density & 7) << 2); | 3059 | ((sta->ht_cap.ampdu_density & 7) << 2); |
3058 | if (hw->conf.channel->band == IEEE80211_BAND_2GHZ) | 3060 | if (hw->conf.channel->band == IEEE80211_BAND_2GHZ) |