[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1434924729-21086-1-git-send-email-gascoar@gmail.com>
Date: Sun, 21 Jun 2015 19:12:09 -0300
From: Gaston Gonzalez <gascoar@...il.com>
To: gregkh@...uxfoundation.org
Cc: paul.gortmaker@...driver.com, dilekuzulmez@...il.com,
gdonald@...il.com, arnd@...db.de, cristina.opriceana@...il.com,
hamohammed.sa@...il.com, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org, gascoar@...il.com
Subject: [PATCH] staging: rtl8192u: ieee80211_rx: Fix incorrect type in assignments
Fix the following incorrect type in assignments detected by sparse:
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:571:37: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:571:37: expected unsigned short [unsigned] [usertype] len
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:571:37: got restricted __be16 [usertype] <noident>
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1330:45: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1330:45: expected unsigned short [unsigned] [usertype] len
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1330:45: got restricted __be16 [usertype] <noident>
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1495:40: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1495:40: expected restricted __le16 <noident>
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1495:40: got int
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1497:40: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1497:40: expected restricted __le16 <noident>
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1497:40: got int
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1501:45: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1501:45: expected restricted __le16 <noident>
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1501:45: got unsigned short [unsigned] [usertype] <noident>
Signed-off-by: Gaston Gonzalez <gascoar@...il.com>
---
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index b374088..15bcf7e 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -566,7 +566,7 @@ void ieee80211_indicate_packets(struct ieee80211_device *ieee, struct ieee80211_
memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, ETH_ALEN);
memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, ETH_ALEN);
} else {
- u16 len;
+ __be16 len;
/* Leave Ethernet header part of hdr and full payload */
len = htons(sub_skb->len);
memcpy(skb_push(sub_skb, 2), &len, 2);
@@ -1325,7 +1325,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
memcpy(skb_push(sub_skb, ETH_ALEN), src, ETH_ALEN);
memcpy(skb_push(sub_skb, ETH_ALEN), dst, ETH_ALEN);
} else {
- u16 len;
+ __be16 len;
/* Leave Ethernet header part of hdr and full payload */
len = htons(sub_skb->len);
memcpy(skb_push(sub_skb, 2), &len, 2);
@@ -1492,13 +1492,15 @@ static int ieee80211_qos_convert_ac_to_parameters(struct
/* WMM spec P.11: The minimum value for AIFSN shall be 2 */
qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? 2:qos_param->aifs[aci];
- qos_param->cw_min[aci] = ac_params->ecw_min_max & 0x0F;
+ qos_param->cw_min[aci] =
+ cpu_to_le16(ac_params->ecw_min_max & 0x0F);
- qos_param->cw_max[aci] = (ac_params->ecw_min_max & 0xF0) >> 4;
+ qos_param->cw_max[aci] =
+ cpu_to_le16((ac_params->ecw_min_max & 0xF0) >> 4);
qos_param->flag[aci] =
(ac_params->aci_aifsn & 0x10) ? 0x01 : 0x00;
- qos_param->tx_op_limit[aci] = le16_to_cpu(ac_params->tx_op_limit);
+ qos_param->tx_op_limit[aci] = ac_params->tx_op_limit;
}
return 0;
}
--
2.4.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists