linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_*.
@ 2018-03-24  4:10 Quytelda Kahja
  2018-03-24  4:10 ` [PATCH 2/3] ieee80211: Replace bit shifts with the BIT() macro for measurement masks Quytelda Kahja
                   ` (3 more replies)
  0 siblings, 4 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-24  4:10 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, linux-kernel, Quytelda Kahja

It is neater and more consistent with the rest of the document to use the
BIT() macro from 'linux/bitops.h' to define the WLAN_CAPABILITY_*
bitmasks.  In the case of WLAN_CAPABILITY_DMG_TYPE_{IBSS, PBSS, AP},
bitshifting integers by 0 does nothing, so there is no reason to do it in
the code; replace these values with plain integers.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 include/linux/ieee80211.h | 56 +++++++++++++++++++++++------------------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index ee6657a0ed69..58069176b432 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1588,8 +1588,8 @@ struct ieee80211_vht_operation {
 
 #define WLAN_AUTH_CHALLENGE_LEN 128
 
-#define WLAN_CAPABILITY_ESS		(1<<0)
-#define WLAN_CAPABILITY_IBSS		(1<<1)
+#define WLAN_CAPABILITY_ESS		BIT(0)
+#define WLAN_CAPABILITY_IBSS		BIT(1)
 
 /*
  * A mesh STA sets the ESS and IBSS capability bits to zero.
@@ -1599,37 +1599,37 @@ struct ieee80211_vht_operation {
 #define WLAN_CAPABILITY_IS_STA_BSS(cap)	\
 	(!((cap) & (WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS)))
 
-#define WLAN_CAPABILITY_CF_POLLABLE	(1<<2)
-#define WLAN_CAPABILITY_CF_POLL_REQUEST	(1<<3)
-#define WLAN_CAPABILITY_PRIVACY		(1<<4)
-#define WLAN_CAPABILITY_SHORT_PREAMBLE	(1<<5)
-#define WLAN_CAPABILITY_PBCC		(1<<6)
-#define WLAN_CAPABILITY_CHANNEL_AGILITY	(1<<7)
+#define WLAN_CAPABILITY_CF_POLLABLE	BIT(2)
+#define WLAN_CAPABILITY_CF_POLL_REQUEST	BIT(3)
+#define WLAN_CAPABILITY_PRIVACY		BIT(4)
+#define WLAN_CAPABILITY_SHORT_PREAMBLE	BIT(5)
+#define WLAN_CAPABILITY_PBCC		BIT(6)
+#define WLAN_CAPABILITY_CHANNEL_AGILITY	BIT(7)
 
 /* 802.11h */
-#define WLAN_CAPABILITY_SPECTRUM_MGMT	(1<<8)
-#define WLAN_CAPABILITY_QOS		(1<<9)
-#define WLAN_CAPABILITY_SHORT_SLOT_TIME	(1<<10)
-#define WLAN_CAPABILITY_APSD		(1<<11)
-#define WLAN_CAPABILITY_RADIO_MEASURE	(1<<12)
-#define WLAN_CAPABILITY_DSSS_OFDM	(1<<13)
-#define WLAN_CAPABILITY_DEL_BACK	(1<<14)
-#define WLAN_CAPABILITY_IMM_BACK	(1<<15)
+#define WLAN_CAPABILITY_SPECTRUM_MGMT	BIT(8)
+#define WLAN_CAPABILITY_QOS		BIT(9)
+#define WLAN_CAPABILITY_SHORT_SLOT_TIME	BIT(10)
+#define WLAN_CAPABILITY_APSD		BIT(11)
+#define WLAN_CAPABILITY_RADIO_MEASURE	BIT(12)
+#define WLAN_CAPABILITY_DSSS_OFDM	BIT(13)
+#define WLAN_CAPABILITY_DEL_BACK	BIT(14)
+#define WLAN_CAPABILITY_IMM_BACK	BIT(15)
 
 /* DMG (60gHz) 802.11ad */
 /* type - bits 0..1 */
-#define WLAN_CAPABILITY_DMG_TYPE_MASK		(3<<0)
-#define WLAN_CAPABILITY_DMG_TYPE_IBSS		(1<<0) /* Tx by: STA */
-#define WLAN_CAPABILITY_DMG_TYPE_PBSS		(2<<0) /* Tx by: PCP */
-#define WLAN_CAPABILITY_DMG_TYPE_AP		(3<<0) /* Tx by: AP */
-
-#define WLAN_CAPABILITY_DMG_CBAP_ONLY		(1<<2)
-#define WLAN_CAPABILITY_DMG_CBAP_SOURCE		(1<<3)
-#define WLAN_CAPABILITY_DMG_PRIVACY		(1<<4)
-#define WLAN_CAPABILITY_DMG_ECPAC		(1<<5)
-
-#define WLAN_CAPABILITY_DMG_SPECTRUM_MGMT	(1<<8)
-#define WLAN_CAPABILITY_DMG_RADIO_MEASURE	(1<<12)
+#define WLAN_CAPABILITY_DMG_TYPE_MASK   (BIT(0) | BIT(1))
+#define WLAN_CAPABILITY_DMG_TYPE_IBSS   1 /* Tx by: STA */
+#define WLAN_CAPABILITY_DMG_TYPE_PBSS   2 /* Tx by: PCP */
+#define WLAN_CAPABILITY_DMG_TYPE_AP     3 /* Tx by: AP */
+
+#define WLAN_CAPABILITY_DMG_CBAP_ONLY		BIT(2)
+#define WLAN_CAPABILITY_DMG_CBAP_SOURCE		BIT(3)
+#define WLAN_CAPABILITY_DMG_PRIVACY		BIT(4)
+#define WLAN_CAPABILITY_DMG_ECPAC		BIT(5)
+
+#define WLAN_CAPABILITY_DMG_SPECTRUM_MGMT	BIT(8)
+#define WLAN_CAPABILITY_DMG_RADIO_MEASURE	BIT(12)
 
 /* measurement */
 #define IEEE80211_SPCT_MSR_RPRT_MODE_LATE	(1<<0)
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2018-03-27 13:23 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-24  4:10 [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_* Quytelda Kahja
2018-03-24  4:10 ` [PATCH 2/3] ieee80211: Replace bit shifts with the BIT() macro for measurement masks Quytelda Kahja
2018-03-24  4:10 ` [PATCH 3/3] ieee80211: Replace bit shifts with the BIT() macro for 802.11g ERP IEs Quytelda Kahja
2018-03-24 21:23 ` [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_* Larry Finger
2018-03-24 23:02   ` Quytelda Kahja
2018-03-27 13:16     ` Johannes Berg
2018-03-25 14:05 ` kbuild test robot
2018-03-26  9:15   ` Quytelda Kahja
2018-03-26  9:18     ` [PATCH] staging: rtl8723bs: Remove duplicate #defines Quytelda Kahja
2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
2018-03-27  8:40       ` [PATCH 02/23] staging: rtl8723bs: Remove #defines shadowing enums in 'linux/ieee80211.h' Quytelda Kahja
2018-03-27  8:40       ` [PATCH 03/23] staging: rtl8723bs: Replace RTW_IEEE80211_FCTL_* with IEEE80211_FCTL_* Quytelda Kahja
2018-03-27  8:40       ` [PATCH 04/23] staging: rtl8723bs: Replace RTW_IEEE80211_FTYPE_* with IEEE80211_FTYPE_* Quytelda Kahja
2018-03-27  8:40       ` [PATCH 05/23] staging: rtl8723bs: Replace RTW_IEEE80211_STYPE_* with IEEE80211_STYPE_* Quytelda Kahja
2018-03-27  8:40       ` [PATCH 06/23] staging: rtl8723bs: Fix newlines in rtw_wx_set_auth() Quytelda Kahja
2018-03-27  8:40       ` [PATCH 07/23] staging: rtl8723bs: Remove unecessary braces from switch statement Quytelda Kahja
2018-03-27  8:41       ` [PATCH 08/23] staging: rtl8723bs: Remove braces from single statement conditionals Quytelda Kahja
2018-03-27  8:41       ` [PATCH 09/23] staging: rtl8723bs: Fix alignment in rtw_wx_set_auth() Quytelda Kahja
2018-03-27  8:41       ` [PATCH 10/23] staging: rtl8723bs: Fix IEEE80211 authentication algorithm constants Quytelda Kahja
2018-03-27  8:41       ` [PATCH 11/23] staging: rtl8723bs: Remove unnecessary length #define's Quytelda Kahja
2018-03-27  8:41       ` [PATCH 12/23] staging: rtl8723bs: Fix lines with trailing open parentheses Quytelda Kahja
2018-03-27  8:41       ` [PATCH 13/23] staging: rtl8723bs: Add spaces around ternary operators Quytelda Kahja
2018-03-27  8:41       ` [PATCH 14/23] staging: rtl8723bs: Add missing braces in else statement Quytelda Kahja
2018-03-27  8:41       ` [PATCH 15/23] staging: rtl8723bs: Change camel case to snake case in 'rtl8723bs_recv.c' Quytelda Kahja
2018-03-27  8:41       ` [PATCH 16/23] staging: rtl8723bs: Remove unnecessary blank lines " Quytelda Kahja
2018-03-27  8:41       ` [PATCH 17/23] staging: rtl8723bs: Fix lines too long in update_recvframe_attrib() Quytelda Kahja
2018-03-27  8:41       ` [PATCH 18/23] staging: rtl8723bs: Fix function signature that goes over 80 characters Quytelda Kahja
2018-03-27  8:41       ` [PATCH 19/23] staging: rtl8723bs: Factor out rtl8723bs_recv_tasklet() sections Quytelda Kahja
2018-03-27  8:41       ` [PATCH 20/23] staging: rtl8723bs: Replace NULL pointer comparison with '!' Quytelda Kahja
2018-03-27  8:41       ` [PATCH 21/23] staging: rtl8723bs: Rework 'struct _ODM_Per_Pkt_Info_' coding style Quytelda Kahja
2018-03-27  8:41       ` [PATCH 22/23] staging: rtl8723bs: Rework 'struct _ODM_Phy_Status_Info_' " Quytelda Kahja
2018-03-27  8:41       ` [PATCH 23/23] staging: rtl8723bs: Remove unecessary newlines from 'odm.h' Quytelda Kahja

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).