Staging: rtl8192e: Fix incorrect type in assignment in rtl_core.c
authorRashika Kheria <rashika.kheria@gmail.com>
Thu, 7 Nov 2013 13:45:48 +0000 (19:15 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Nov 2013 20:02:22 +0000 (12:02 -0800)
This patch fixes the following sparse warning in rtl8192e/rtl_core.c-

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:10: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:10:    expected  restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:10:    got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:13: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:13:    expected restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:13:    got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:16: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:16:    expected restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:16:    got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:19: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:19:        expected restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:19:    got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:10: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:10:    expected restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:10:    got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:13: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:13:         expected restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:13:         got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:16: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:16:    expected restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:16:    got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:19: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:19:    expected restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:19:    got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2012:12: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2012:12:        expected unsigned short [unsigned] [usertype] fc
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2012:12:        got restricted __le16 [usertype] frame_ctl

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2102:46: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2102:46:   expected unsigned int [unsigned] [usertype] BufferAddress
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2102:46:   got restricted __le32 [usertype] <noident>

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2137:41: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2137:41:   expected unsigned int [unsigned] [usertype] NextDescAddress
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2137:41:         got restricted __le32 [usertype] <noident>

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2401:38: warning: incorrect type in assignment rtllib_softmac.c(different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2401:38:         expected unsigned int [unsigned] [usertype] BufferAddress
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2401:38:   got restricted __le32 [usertype] <noident>

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/rtl_core.c

index ceb29c8..d36d6bb 100644 (file)
@@ -562,8 +562,8 @@ void rtl8192_update_cap(struct net_device *dev, u16 cap)
 }
 
 static struct rtllib_qos_parameters def_qos_parameters = {
-       {3, 3, 3, 3},
-       {7, 7, 7, 7},
+       {cpu_to_le16(3), cpu_to_le16(3), cpu_to_le16(3), cpu_to_le16(3)},
+       {cpu_to_le16(7), cpu_to_le16(7), cpu_to_le16(7), cpu_to_le16(7)},
        {2, 2, 2, 2},
        {0, 0, 0, 0},
        {0, 0, 0, 0}
@@ -2009,7 +2009,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
        fwinfo_size = sizeof(struct tx_fwinfo_8190pci);
 
        header = (struct rtllib_hdr_1addr *)(((u8 *)skb->data) + fwinfo_size);
-       fc = header->frame_ctl;
+       fc = le16_to_cpu(header->frame_ctl);
        type = WLAN_FC_GET_TYPE(fc);
        stype = WLAN_FC_GET_STYPE(fc);
        pda_addr = header->addr1;
@@ -2099,7 +2099,7 @@ static short rtl8192_alloc_rx_desc_ring(struct net_device *dev)
                                dev_kfree_skb_any(skb);
                                return -1;
                        }
-                       entry->BufferAddress = cpu_to_le32(*mapping);
+                       entry->BufferAddress = *mapping;
 
                        entry->Length = priv->rxbuffersize;
                        entry->OWN = 1;
@@ -2135,8 +2135,8 @@ static int rtl8192_alloc_tx_desc_ring(struct net_device *dev,
 
        for (i = 0; i < entries; i++)
                ring[i].NextDescAddress =
-                       cpu_to_le32((u32)dma + ((i + 1) % entries) *
-                       sizeof(*ring));
+                       (u32)dma + ((i + 1) % entries) *
+                       sizeof(*ring);
 
        return 0;
 }
@@ -2398,7 +2398,7 @@ static void rtl8192_rx_normal(struct net_device *dev)
                        }
                }
 done:
-               pdesc->BufferAddress = cpu_to_le32(*((dma_addr_t *)skb->cb));
+               pdesc->BufferAddress = *((dma_addr_t *)skb->cb);
                pdesc->OWN = 1;
                pdesc->Length = priv->rxbuffersize;
                if (priv->rx_idx[rx_queue_idx] == priv->rxringcount-1)