Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jannik Becher and committed by
Greg Kroah-Hartman
3d7164c3 dd916148

+4 -4
+2 -2
drivers/staging/rtl8712/rtl871x_security.c
··· 1047 1047 u8 aes_out[16]; 1048 1048 u8 padded_buffer[16]; 1049 1049 u8 mic[8]; 1050 - uint frtype = GetFrameType(pframe); 1051 - uint frsubtype = GetFrameSubType(pframe); 1050 + u16 frtype = GetFrameType(pframe); 1051 + u16 frsubtype = GetFrameSubType(pframe); 1052 1052 1053 1053 frsubtype >>= 4; 1054 1054 memset((void *)mic_iv, 0, 16);
+2 -2
drivers/staging/rtl8712/wifi.h
··· 229 229 #define GetOrder(pbuf) (((*(unsigned short *)(pbuf)) & \ 230 230 le16_to_cpu(_ORDER_)) != 0) 231 231 232 - #define GetFrameType(pbuf) (le16_to_cpu(*(unsigned short *)(pbuf)) & \ 232 + #define GetFrameType(pbuf) (le16_to_cpu(*(__le16 *)(pbuf)) & \ 233 233 (BIT(3) | BIT(2))) 234 234 235 235 #define SetFrameType(pbuf, type) \ ··· 239 239 *(unsigned short *)(pbuf) |= cpu_to_le16(type); \ 240 240 } while (0) 241 241 242 - #define GetFrameSubType(pbuf) (cpu_to_le16(*(unsigned short *)(pbuf)) & \ 242 + #define GetFrameSubType(pbuf) (le16_to_cpu(*(__le16 *)(pbuf)) & \ 243 243 (BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | \ 244 244 BIT(2))) 245 245