Commit 3d7164c3 authored by Jannik Becher's avatar Jannik Becher Committed by Greg Kroah-Hartman

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: default avatarJannik Becher <becher.jannik@gmail.com>
Tested-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dd916148
......@@ -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);
......
......@@ -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)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment