From: Rashika Kheria Date: Thu, 7 Nov 2013 13:45:48 +0000 (+0530) Subject: Staging: rtl8192e: Fix incorrect type in assignment in rtl_core.c X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=34e987e6ff615b97fbf8d3bb273ff343fa2ed8b6;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Staging: rtl8192e: Fix incorrect type in assignment in rtl_core.c 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] 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] 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] Signed-off-by: Rashika Kheria Reviewed-by: Peter P Waskiewicz Jr Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index ceb29c8032f3..d36d6bb91342 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -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)