Staging: rtl8192e: Fix Sparse Warning of invalid assignment in rtllib_tx.c
authorMonam Agarwal <monamagarwal123@gmail.com>
Thu, 6 Mar 2014 21:09:44 +0000 (02:39 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Mar 2014 00:13:39 +0000 (16:13 -0800)
This patch fixes following sparse warnings:
drivers/staging/rtl8192e/rtllib_tx.c:942:45: warning: invalid assignment: +=
drivers/staging/rtl8192e/rtllib_tx.c:942:45:    left side has type unsigned long
drivers/staging/rtl8192e/rtllib_tx.c:942:45:    right side has type restricted __le16
drivers/staging/rtl8192e/rtllib_tx.c:947:49: warning: invalid assignment: +=
drivers/staging/rtl8192e/rtllib_tx.c:947:49:    left side has type unsigned long
drivers/staging/rtl8192e/rtllib_tx.c:947:49:    right side has type restricted __le16

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtllib_tx.c

index 77964885b3f22d2d51dae39b93da7e78088ee312..11d0a9d8ee59fc911dd753c425cfe1e9f698ca5f 100644 (file)
@@ -939,12 +939,12 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
        if (txb) {
                if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE) {
                        dev->stats.tx_packets++;
-                       dev->stats.tx_bytes += txb->payload_size;
+                       dev->stats.tx_bytes += le16_to_cpu(txb->payload_size);
                        rtllib_softmac_xmit(txb, ieee);
                } else {
                        if ((*ieee->hard_start_xmit)(txb, dev) == 0) {
                                stats->tx_packets++;
-                               stats->tx_bytes += txb->payload_size;
+                               stats->tx_bytes += le16_to_cpu(txb->payload_size);
                                return 0;
                        }
                        rtllib_txb_free(txb);