Skip to contentSkip to conversation

staging: rtl8723bs: include: Remove typedef for struct.

PATCH Superseded Sanjana Sanikommu 2 participants 3 messages Apr 2, 2019 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: include: Remove typedef for struct.

Challenge suggested by coccinelle.

Linux kernel coding style guidelines suggest not using typedefs for structure.

---
 drivers/staging/rtl8723bs/include/ieee80211.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8723bs/include/ieee80211.h +6 -6
index 9efb4dcb9d3a..ce523dfb6faf 100644
@@ -202,7 +202,7 @@ enum NETWORK_TYPE
 #define IsSupportedVHT(NetType) (((NetType) & (WIRELESS_11AC)) ? true : false)
 
 
-typedef struct ieee_param {
+struct ieee_param {
 	u32 cmd;
 	u8 sta_addr[ETH_ALEN];
 	union {
@@ -240,13 +240,13 @@ typedef struct ieee_param {
 			u8 buf[0];
 		} bcn_ie;
 	} u;
-}ieee_param;
+};
 
-typedef struct ieee_param_ex {
+struct ieee_param_ex {
 	u32 cmd;
 	u8 sta_addr[ETH_ALEN];
 	u8 data[0];
-}ieee_param_ex;
+};
 
 struct sta_data{
 	u16 aid;
@@ -870,10 +870,10 @@ static inline int is_zero_mac_addr(const u8 *addr)
 #define CFG_IEEE80211_RESERVE_FCS (1<<0)
 #define CFG_IEEE80211_COMPUTE_FCS (1<<1)
 
-typedef struct tx_pending_t{
+struct tx_pending_t {
 	int frag;
 	struct ieee80211_txb *txb;
-}tx_pending_t;
+};
 
 
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 41 lines · Sanjana Sanikommu

Challenge suggested by coccinelle.

Linux kernel coding style guidelines suggest not using typedefs for structure.

---
 drivers/staging/rtl8723bs/include/ieee80211.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8723bs/include/ieee80211.h +4 -4
index 9efb4dcb9d3a..ce523dfb6faf 100644
@@ -202,7 +202,7 @@ enum NETWORK_TYPE
 #define IsSupportedVHT(NetType) (((NetType) & (WIRELESS_11AC)) ? true : false)
 
 
-typedef struct ieee_param {
+struct ieee_param {
 	u32 cmd;
 	u8 sta_addr[ETH_ALEN];
 	union {
@@ -240,13 +240,13 @@ typedef struct ieee_param {
 			u8 buf[0];
 		} bcn_ie;
 	} u;
-}ieee_param;
+};
 
-typedef struct ieee_param_ex {
+struct ieee_param_ex {
 	u32 cmd;
 	u8 sta_addr[ETH_ALEN];
 	u8 data[0];
-}ieee_param_ex;
+};
 
 struct sta_data{
 	u16 aid;

drivers/staging/rtl8723bs/include/ieee80211.h static inline int is_zero_mac_addr(const u8 *addr) · line 876

Quoted 9 lines
drivers/staging/rtl8723bs/include/ieee80211.h +2 -2
@@ -870,10 +870,10 @@ static inline int is_zero_mac_addr(const u8 *addr)
 #define CFG_IEEE80211_RESERVE_FCS (1<<0)
 #define CFG_IEEE80211_COMPUTE_FCS (1<<1)
 
-typedef struct tx_pending_t{
+struct tx_pending_t {
 	int frag;
 	struct ieee80211_txb *txb;
-}tx_pending_t;
+};

This structure isn't used anywhere, right? So why not just submit a patch to delete it?

thanks,

greg k-h

#2 lore raw
Quoted 47 lines · On Tue, 2 Apr 2019, 12:12 Greg KH, <[email protected]> wrote:

Review

Quoted 11 lines · Sanjana Sanikommu

Challenge suggested by coccinelle.

Linux kernel coding style guidelines suggest not using typedefs for structure.

---
 drivers/staging/rtl8723bs/include/ieee80211.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
(quoted diff) +0 -0

b/drivers/staging/rtl8723bs/include/ieee80211.h

drivers/staging/rtl8723bs/include/ieee80211.h enum NETWORK_TYPE · line 202

Quoted 5 lines

index 9efb4dcb9d3a..ce523dfb6faf 100644

drivers/staging/rtl8723bs/include/ieee80211.h +0 -0
@@ -202,7 +202,7 @@ enum NETWORK_TYPE
 #define IsSupportedVHT(NetType) (((NetType) & (WIRELESS_11AC)) ? true :

false)

Quoted 28 lines
drivers/staging/rtl8723bs/include/ieee80211.h +4 -4
-typedef struct ieee_param {
+struct ieee_param {
      u32 cmd;
      u8 sta_addr[ETH_ALEN];
      union {
@@ -240,13 +240,13 @@ typedef struct ieee_param {
                      u8 buf[0];
              } bcn_ie;
      } u;
-}ieee_param;
+};
 
-typedef struct ieee_param_ex {
+struct ieee_param_ex {
      u32 cmd;
      u8 sta_addr[ETH_ALEN];
      u8 data[0];
-}ieee_param_ex;
+};
 
 struct sta_data{
      u16 aid;
@@ -870,10 +870,10 @@ static inline int is_zero_mac_addr(const u8 *addr)
 #define CFG_IEEE80211_RESERVE_FCS (1<<0)
 #define CFG_IEEE80211_COMPUTE_FCS (1<<1)
 
Quoted 10 lines

drivers/staging/rtl8723bs/include/ieee80211.h static inline int is_zero_mac_addr(const u8 *addr) · line 876

Quoted 6 lines
drivers/staging/rtl8723bs/include/ieee80211.h +2 -2
-typedef struct tx_pending_t{
+struct tx_pending_t {
      int frag;
      struct ieee80211_txb *txb;
-}tx_pending_t;
+};

This structure isn't used anywhere, right? So why not just submit a patch to delete it?

Sure, I will remove and sumbit again :)
Thanks
Sanjana

Quoted 5 lines

thanks,

greg k-h