summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8712
diff options
context:
space:
mode:
authorJannik Becher <becher.jannik@gmail.com>2016-12-20 18:59:42 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-03 16:51:16 +0100
commit3d7164c3790adfb34472c42e6290748b03e1d1d0 (patch)
tree7d520dcee381bfa05e9d72ad81b77cfd27e373c4 /drivers/staging/rtl8712
parentdd9161483f420c2ead89f8514956b7717d4ea504 (diff)
staging: rtl8712: changed GetFrameSubType macro
Fixed a sparse warning. GetFrameSubType and GetFrameType should cast to __le16. Furthermore GetFramSubType should use le16_to_cpu instead of cpu_to_le16. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712')
-rw-r--r--drivers/staging/rtl8712/rtl871x_security.c4
-rw-r--r--drivers/staging/rtl8712/wifi.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_security.c b/drivers/staging/rtl8712/rtl871x_security.c
index 3400e49c6ce4..62d56943238f 100644
--- a/drivers/staging/rtl8712/rtl871x_security.c
+++ b/drivers/staging/rtl8712/rtl871x_security.c
@@ -1047,8 +1047,8 @@ static sint aes_cipher(u8 *key, uint hdrlen,
u8 aes_out[16];
u8 padded_buffer[16];
u8 mic[8];
- uint frtype = GetFrameType(pframe);
- uint frsubtype = GetFrameSubType(pframe);
+ u16 frtype = GetFrameType(pframe);
+ u16 frsubtype = GetFrameSubType(pframe);
frsubtype >>= 4;
memset((void *)mic_iv, 0, 16);
diff --git a/drivers/staging/rtl8712/wifi.h b/drivers/staging/rtl8712/wifi.h
index b8af9656e6da..7ebf247b2aff 100644
--- a/drivers/staging/rtl8712/wifi.h
+++ b/drivers/staging/rtl8712/wifi.h
@@ -229,7 +229,7 @@ enum WIFI_REG_DOMAIN {
#define GetOrder(pbuf) (((*(unsigned short *)(pbuf)) & \
le16_to_cpu(_ORDER_)) != 0)
-#define GetFrameType(pbuf) (le16_to_cpu(*(unsigned short *)(pbuf)) & \
+#define GetFrameType(pbuf) (le16_to_cpu(*(__le16 *)(pbuf)) & \
(BIT(3) | BIT(2)))
#define SetFrameType(pbuf, type) \
@@ -239,7 +239,7 @@ enum WIFI_REG_DOMAIN {
*(unsigned short *)(pbuf) |= cpu_to_le16(type); \
} while (0)
-#define GetFrameSubType(pbuf) (cpu_to_le16(*(unsigned short *)(pbuf)) & \
+#define GetFrameSubType(pbuf) (le16_to_cpu(*(__le16 *)(pbuf)) & \
(BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | \
BIT(2)))