staging: rtl8188eu: fix code styling issues
v2 cover staging: rtl8188eu: fix code styling issues
These patches fix:
- whitespaces styling issues
- use pr_cont() instead of printk()
- prefer using BIT macro
Changes in v2:
- removed build errors
Aastha Gupta (3):
staging: rtl8188eu: prefer using BIT macro
staging: rtl8188eu: add spaces around '|'
staging: rtl8188eu: use pr_cont()
drivers/staging/rtl8188eu/include/ieee80211.h | 84 +++++++++++++-------------- drivers/staging/rtl8188eu/include/rtw_debug.h | 4 +- 2 files changed, 44 insertions(+), 44 deletions(-)
Signature · 1 line
2.7.4
PATCH v2 1/3 staging: rtl8188eu: prefer using BIT macro
Fixes checkpatch.pl:
Use BIT(x) instead of using (1<<x)
--- drivers/staging/rtl8188eu/include/ieee80211.h | 78 +++++++++++++-------------- 1 file changed, 39 insertions(+), 39 deletions(-)
drivers/staging/rtl8188eu/include/ieee80211.h +39 -39
@@ -359,11 +359,11 @@ struct ieee80211_snap_hdr {#define IEEE80211_DATA_HDR3_LEN 24#define IEEE80211_DATA_HDR4_LEN 30 -#define IEEE80211_CCK_MODULATION (1<<0) -#define IEEE80211_OFDM_MODULATION (1<<1) +#define IEEE80211_CCK_MODULATION BIT(0) +#define IEEE80211_OFDM_MODULATION BIT(1) -#define IEEE80211_24GHZ_BAND (1<<0) -#define IEEE80211_52GHZ_BAND (1<<1) +#define IEEE80211_24GHZ_BAND BIT(0) +#define IEEE80211_52GHZ_BAND BIT(1)#define IEEE80211_CCK_RATE_LEN 4#define IEEE80211_NUM_OFDM_RATESLEN 8
@@ -384,18 +384,18 @@ struct ieee80211_snap_hdr {#define IEEE80211_OFDM_RATE_54MB 0x6C#define IEEE80211_BASIC_RATE_MASK 0x80 -#define IEEE80211_CCK_RATE_1MB_MASK (1<<0) -#define IEEE80211_CCK_RATE_2MB_MASK (1<<1) -#define IEEE80211_CCK_RATE_5MB_MASK (1<<2) -#define IEEE80211_CCK_RATE_11MB_MASK (1<<3) -#define IEEE80211_OFDM_RATE_6MB_MASK (1<<4) -#define IEEE80211_OFDM_RATE_9MB_MASK (1<<5) -#define IEEE80211_OFDM_RATE_12MB_MASK (1<<6) -#define IEEE80211_OFDM_RATE_18MB_MASK (1<<7) -#define IEEE80211_OFDM_RATE_24MB_MASK (1<<8) -#define IEEE80211_OFDM_RATE_36MB_MASK (1<<9) -#define IEEE80211_OFDM_RATE_48MB_MASK (1<<10) -#define IEEE80211_OFDM_RATE_54MB_MASK (1<<11) +#define IEEE80211_CCK_RATE_1MB_MASK BIT(0) +#define IEEE80211_CCK_RATE_2MB_MASK BIT(1) +#define IEEE80211_CCK_RATE_5MB_MASK BIT(2) +#define IEEE80211_CCK_RATE_11MB_MASK BIT(3) +#define IEEE80211_OFDM_RATE_6MB_MASK BIT(4) +#define IEEE80211_OFDM_RATE_9MB_MASK BIT(5) +#define IEEE80211_OFDM_RATE_12MB_MASK BIT(6) +#define IEEE80211_OFDM_RATE_18MB_MASK BIT(7) +#define IEEE80211_OFDM_RATE_24MB_MASK BIT(8) +#define IEEE80211_OFDM_RATE_36MB_MASK BIT(9) +#define IEEE80211_OFDM_RATE_48MB_MASK BIT(10) +#define IEEE80211_OFDM_RATE_54MB_MASK BIT(11)#define IEEE80211_CCK_RATES_MASK 0x0000000F#define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \
@@ -428,15 +428,15 @@ struct ieee80211_snap_hdr {*/ #define IEEE80211_FRAG_CACHE_LEN 4 -#define SEC_KEY_1 (1<<0) -#define SEC_KEY_2 (1<<1) -#define SEC_KEY_3 (1<<2) -#define SEC_KEY_4 (1<<3) -#define SEC_ACTIVE_KEY (1<<4) -#define SEC_AUTH_MODE (1<<5) -#define SEC_UNICAST_GROUP (1<<6) -#define SEC_LEVEL (1<<7) -#define SEC_ENABLED (1<<8) +#define SEC_KEY_1 BIT(0) +#define SEC_KEY_2 BIT(1) +#define SEC_KEY_3 BIT(2) +#define SEC_KEY_4 BIT(3) +#define SEC_ACTIVE_KEY BIT(4) +#define SEC_AUTH_MODE BIT(5) +#define SEC_UNICAST_GROUP BIT(6) +#define SEC_LEVEL BIT(7) +#define SEC_ENABLED BIT(8)#define SEC_LEVEL_0 0/* None */ #define SEC_LEVEL_1 1/* WEP 40 and 104 bit */
@@ -470,9 +470,9 @@ struct ieee80211_snap_hdr {#define MAX_P2P_IE_LEN (256)#define MAX_WFD_IE_LEN (128) -#define NETWORK_EMPTY_ESSID (1<<0) -#define NETWORK_HAS_OFDM (1<<1) -#define NETWORK_HAS_CCK (1<<2) +#define NETWORK_EMPTY_ESSID BIT(0) +#define NETWORK_HAS_OFDM BIT(1) +#define NETWORK_HAS_CCK BIT(2)#define IW_ESSID_MAX_SIZE 32/*
@@ -534,14 +534,14 @@ static inline int is_broadcast_mac_addr(const u8 *addr) (addr[3 ] ==0xff ) && (addr[4 ] ==0xff ) && (addr[5 ] ==0xff ); } -#define CFG_IEEE80211_RESERVE_FCS (1<<0) -#define CFG_IEEE80211_COMPUTE_FCS (1<<1) +#define CFG_IEEE80211_RESERVE_FCS BIT(0) +#define CFG_IEEE80211_COMPUTE_FCS BIT(1)#define MAXTID 16 -#define IEEE_A (1<<0) -#define IEEE_B (1<<1) -#define IEEE_G (1<<2) +#define IEEE_A BIT(0) +#define IEEE_B BIT(1) +#define IEEE_G BIT(2)#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G)/* Action category code */
@@ -659,12 +659,12 @@ enum rtw_ieee80211_back_parties {* is not permitted. */ enum rtw_ieee80211_channel_flags { -RTW_IEEE80211_CHAN_DISABLED =1 <<0 , -RTW_IEEE80211_CHAN_PASSIVE_SCAN =1 <<1 , -RTW_IEEE80211_CHAN_NO_IBSS =1 <<2 , -RTW_IEEE80211_CHAN_RADAR =1 <<3 , -RTW_IEEE80211_CHAN_NO_HT40PLUS =1 <<4 , -RTW_IEEE80211_CHAN_NO_HT40MINUS =1 <<5 , +RTW_IEEE80211_CHAN_DISABLED =BIT (0 ), +RTW_IEEE80211_CHAN_PASSIVE_SCAN =BIT (1 ), +RTW_IEEE80211_CHAN_NO_IBSS =BIT (2 ), +RTW_IEEE80211_CHAN_RADAR =BIT (3 ), +RTW_IEEE80211_CHAN_NO_HT40PLUS =BIT (4 ), +RTW_IEEE80211_CHAN_NO_HT40MINUS =BIT (5 ), };#define RTW_IEEE80211_CHAN_NO_HT40 \
Signature · 1 line
2.7.4
PATCH v2 2/3 staging: rtl8188eu: add spaces around '|'
In reply to Aastha GuptaFixes 'use spaces around '|' ' as reported by checkpatch.pl
--- drivers/staging/rtl8188eu/include/ieee80211.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8188eu/include/ieee80211.h +3 -3
@@ -202,9 +202,9 @@ enum NETWORK_TYPE {#define IsSupportedTxCCK (NetType) \ ((NetType) & (WIRELESS_11B) ? true : false)#define IsSupportedTxOFDM (NetType) \ - ((NetType) & (WIRELESS_11G|WIRELESS_11A) ? true : false) + ((NetType) & (WIRELESS_11G | WIRELESS_11A) ? true : false)#define IsSupportedTxMCS (NetType) \ - ((NetType) & (WIRELESS_11_24N|WIRELESS_11_5N) ? true : false) + ((NetType) & (WIRELESS_11_24N | WIRELESS_11_5N) ? true : false)struct ieee_param {
@@ -542,7 +542,7 @@ static inline int is_broadcast_mac_addr(const u8 *addr)#define IEEE_A BIT(0)#define IEEE_B BIT(1)#define IEEE_G BIT(2) -#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) +#define IEEE_MODE_MASK (IEEE_A | IEEE_B | IEEE_G)/* Action category code */ enum rtw_ieee80211_category {
Signature · 1 line
2.7.4
PATCH v2 3/3 staging: rtl8188eu: use pr_cont()
In reply to Aastha GuptaUsing 'printk("\n")' is not preferred anymore as printks without KERN_CONT are emitted on a new line and KERN_CONT is required to continue lines so use pr_cont.
--- drivers/staging/rtl8188eu/include/rtw_debug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8188eu/include/rtw_debug.h +2 -2
@@ -106,9 +106,9 @@ extern u32 GlobalDebugLevel; (((__i +1 ) %4 ) ==0 ) ? \ " " : " "); \if (((__i +1 ) %16 ) ==0 ) \ -printk ("\n" ); \ +pr_cont ("\n" ); \ } \ -printk ("\n" ); \ +pr_cont ("\n" ); \ } \ }while (0 )
Signature · 1 line
2.7.4