From 198e0d17c2f8081a8a1bb75d6047c7c89326fc66 Mon Sep 17 00:00:00 2001
From: Rashika Kheria <rashika.kheria@gmail.com>
Date: Sat, 2 Nov 2013 23:39:22 +0530
Subject: [PATCH] Staging: rtl8192e: Fix incorrect type in assignment in
 rtllib_tx.c

This patch fixes the following sparse warning in rtllib_tx.c-

drivers/staging/rtl8192e/rtllib_tx.c:234:24: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_tx.c:234:24:    expected restricted __le16 [usertype] frag_size
drivers/staging/rtl8192e/rtllib_tx.c:234:24:    got int [signed] txb_size
drivers/staging/rtl8192e/rtllib_tx.c:613:43: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_tx.c:613:43:    expected restricted __le16 [usertype] payload_size
drivers/staging/rtl8192e/rtllib_tx.c:613:43:    got unsigned int [unsigned] len
drivers/staging/rtl8192e/rtllib_tx.c:767:35: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_tx.c:767:35:    expected restricted __le16 [usertype] payload_size
drivers/staging/rtl8192e/rtllib_tx.c:767:35:    got int [signed] [assigned] bytes
drivers/staging/rtl8192e/rtllib_tx.c:814:51: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_tx.c:814:51:    expected restricted __le16 [usertype] seq_ctl
drivers/staging/rtl8192e/rtllib_tx.c:814:51:    got unsigned short
drivers/staging/rtl8192e/rtllib_tx.c:174:36: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_tx.c:174:36:    expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/rtl8192e/rtllib_tx.c:174:36:    got restricted __be16 [usertype] <noident>
drivers/staging/rtl8192e/rtllib_tx.c:873:35: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_tx.c:873:35:    expected restricted __le16 [usertype] payload_size
drivers/staging/rtl8192e/rtllib_tx.c:873:35:    got unsigned int [unsigned] len

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/staging/rtl8192e/rtllib_tx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c
index 3183627823fb..8ff03f8675e8 100644
--- a/drivers/staging/rtl8192e/rtllib_tx.c
+++ b/drivers/staging/rtl8192e/rtllib_tx.c
@@ -171,7 +171,7 @@ inline int rtllib_put_snap(u8 *data, u16 h_proto)
 	snap->oui[1] = oui[1];
 	snap->oui[2] = oui[2];
 
-	*(u16 *)(data + SNAP_SIZE) = htons(h_proto);
+	*(u16 *)(data + SNAP_SIZE) = h_proto;
 
 	return SNAP_SIZE + sizeof(u16);
 }
@@ -231,7 +231,7 @@ static struct rtllib_txb *rtllib_alloc_txb(int nr_frags, int txb_size,
 
 	memset(txb, 0, sizeof(struct rtllib_txb));
 	txb->nr_frags = nr_frags;
-	txb->frag_size = txb_size;
+	txb->frag_size = cpu_to_le16(txb_size);
 
 	for (i = 0; i < nr_frags; i++) {
 		txb->fragments[i] = dev_alloc_skb(txb_size);
@@ -610,7 +610,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
 			}
 
 			txb->encrypted = 0;
-			txb->payload_size = skb->len;
+			txb->payload_size = cpu_to_le16(skb->len);
 			memcpy(skb_put(txb->fragments[0], skb->len), skb->data,
 			       skb->len);
 
@@ -764,7 +764,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
 			goto failed;
 		}
 		txb->encrypted = encrypt;
-		txb->payload_size = bytes;
+		txb->payload_size = cpu_to_le16(bytes);
 
 		if (qos_actived)
 			txb->queue_index = UP2AC(skb->priority);
@@ -812,8 +812,8 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
 			}
 			if ((qos_actived) && (!bIsMulticast)) {
 				frag_hdr->seq_ctl =
-					 rtllib_query_seqnum(ieee, skb_frag,
-							     header.addr1);
+					 cpu_to_le16(rtllib_query_seqnum(ieee, skb_frag,
+							     header.addr1));
 				frag_hdr->seq_ctl =
 					 cpu_to_le16(frag_hdr->seq_ctl<<4 | i);
 			} else {
@@ -870,7 +870,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
 		}
 
 		txb->encrypted = 0;
-		txb->payload_size = skb->len;
+		txb->payload_size = cpu_to_le16(skb->len);
 		memcpy(skb_put(txb->fragments[0], skb->len), skb->data,
 		       skb->len);
 	}
-- 
2.30.9