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

staging: wlan-ng: use GENMASK macro in different defines of p80211hdr.h

This patch replace actual mask stuff using BIT macros with
or operators to make use of GENMASK macro which simplifies
code clearity and readibility.

It applies for defines included in p80211hdr.h header file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Sergio Paracuellos and committed by
Greg Kroah-Hartman
408fec3f e49651b8

+2 -3
+2 -3
drivers/staging/wlan-ng/p80211hdr.h
··· 131 131 /* SET_FC_FSTYPE(WLAN_FSTYPE_RTS) ); */ 132 132 /*------------------------------------------------------------*/ 133 133 134 - #define WLAN_GET_FC_FTYPE(n) ((((u16)(n)) & (BIT(2) | BIT(3))) >> 2) 135 - #define WLAN_GET_FC_FSTYPE(n) ((((u16)(n)) & \ 136 - (BIT(4) | BIT(5) | BIT(6) | BIT(7))) >> 4) 134 + #define WLAN_GET_FC_FTYPE(n) ((((u16)(n)) & GENMASK(3, 2)) >> 2) 135 + #define WLAN_GET_FC_FSTYPE(n) ((((u16)(n)) & GENMASK(7, 4)) >> 4) 137 136 #define WLAN_GET_FC_TODS(n) ((((u16)(n)) & (BIT(8))) >> 8) 138 137 #define WLAN_GET_FC_FROMDS(n) ((((u16)(n)) & (BIT(9))) >> 9) 139 138 #define WLAN_GET_FC_ISWEP(n) ((((u16)(n)) & (BIT(14))) >> 14)