From 5fa7ed322b74d24dd9fb6caa3073bc129cc4a036 Mon Sep 17 00:00:00 2001 From: Sergio Paracuellos Date: Tue, 20 Mar 2018 18:13:14 +0100 Subject: [PATCH] staging: ks7010: review custom bit defines using macros from bitops header file This commit reviews custom definitions using custom bit macros changing them for the ones defined in the bitops header file. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ks7010/eap_packet.h | 31 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/staging/ks7010/eap_packet.h b/drivers/staging/ks7010/eap_packet.h index 1bf1a8c94b0c..58c2a3dafca2 100644 --- a/drivers/staging/ks7010/eap_packet.h +++ b/drivers/staging/ks7010/eap_packet.h @@ -3,10 +3,9 @@ #define EAP_PACKET_H #include +#include #include -#define WBIT(n) (1 << (n)) - #define ETHER_HDR_SIZE 20 struct ether_hdr { @@ -98,23 +97,23 @@ struct wpa_eapol_key { /* followed by key_data_length bytes of key_data */ } __packed; -#define WPA_KEY_INFO_TYPE_MASK (WBIT(0) | WBIT(1) | WBIT(2)) -#define WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 WBIT(0) -#define WPA_KEY_INFO_TYPE_HMAC_SHA1_AES WBIT(1) -#define WPA_KEY_INFO_KEY_TYPE WBIT(3) /* 1 = Pairwise, 0 = Group key */ +#define WPA_KEY_INFO_TYPE_MASK GENMASK(2, 0) +#define WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 BIT(0) +#define WPA_KEY_INFO_TYPE_HMAC_SHA1_AES BIT(1) +#define WPA_KEY_INFO_KEY_TYPE BIT(3) /* 1 = Pairwise, 0 = Group key */ /* bit4..5 is used in WPA, but is reserved in IEEE 802.11i/RSN */ -#define WPA_KEY_INFO_KEY_INDEX_MASK (WBIT(4) | WBIT(5)) +#define WPA_KEY_INFO_KEY_INDEX_MASK GENMASK(5, 4) #define WPA_KEY_INFO_KEY_INDEX_SHIFT 4 -#define WPA_KEY_INFO_INSTALL WBIT(6) /* pairwise */ -#define WPA_KEY_INFO_TXRX WBIT(6) /* group */ -#define WPA_KEY_INFO_ACK WBIT(7) -#define WPA_KEY_INFO_MIC WBIT(8) -#define WPA_KEY_INFO_SECURE WBIT(9) -#define WPA_KEY_INFO_ERROR WBIT(10) -#define WPA_KEY_INFO_REQUEST WBIT(11) -#define WPA_KEY_INFO_ENCR_KEY_DATA WBIT(12) /* IEEE 802.11i/RSN only */ +#define WPA_KEY_INFO_INSTALL BIT(6) /* pairwise */ +#define WPA_KEY_INFO_TXRX BIT(6) /* group */ +#define WPA_KEY_INFO_ACK BIT(7) +#define WPA_KEY_INFO_MIC BIT(8) +#define WPA_KEY_INFO_SECURE BIT(9) +#define WPA_KEY_INFO_ERROR BIT(10) +#define WPA_KEY_INFO_REQUEST BIT(11) +#define WPA_KEY_INFO_ENCR_KEY_DATA BIT(12) /* IEEE 802.11i/RSN only */ -#define WPA_CAPABILITY_PREAUTH WBIT(0) +#define WPA_CAPABILITY_PREAUTH BIT(0) #define GENERIC_INFO_ELEM 0xdd #define RSN_INFO_ELEM 0x30