]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
staging: wlan-ng: use GENMASK macro in different defines of p80211hdr.h
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Thu, 10 Nov 2016 18:16:40 +0000 (19:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Nov 2016 14:43:20 +0000 (15:43 +0100)
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>
drivers/staging/wlan-ng/p80211hdr.h

index c8f78d9923b815282c7d4272bf4684918c8bc787..2c44c613a5864e64d242bc3e2c076812cc1fba5f 100644 (file)
 /*                        SET_FC_FSTYPE(WLAN_FSTYPE_RTS) );   */
 /*------------------------------------------------------------*/
 
-#define WLAN_GET_FC_FTYPE(n)   ((((u16)(n)) & (BIT(2) | BIT(3))) >> 2)
-#define WLAN_GET_FC_FSTYPE(n)  ((((u16)(n)) & \
-                               (BIT(4) | BIT(5) | BIT(6) | BIT(7))) >> 4)
+#define WLAN_GET_FC_FTYPE(n)   ((((u16)(n)) & GENMASK(3, 2)) >> 2)
+#define WLAN_GET_FC_FSTYPE(n)  ((((u16)(n)) & GENMASK(7, 4)) >> 4)
 #define WLAN_GET_FC_TODS(n)    ((((u16)(n)) & (BIT(8))) >> 8)
 #define WLAN_GET_FC_FROMDS(n)  ((((u16)(n)) & (BIT(9))) >> 9)
 #define WLAN_GET_FC_ISWEP(n)   ((((u16)(n)) & (BIT(14))) >> 14)