Staging: wlan-ng: Remove typedefs
PATCH 1/1 Staging: wlan-ng: Remove typedefs
This patch fixes "do not add new typedefs"
checkpatch.pl warning in hfa384x.h
--- drivers/staging/wlan-ng/hfa384x.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/staging/wlan-ng/hfa384x.h +13 -13
@@ -355,7 +355,7 @@ struct hfa384x_bytestr {u8 data[0 ]; } __packed; -typedef struct hfa384x_bytestr32 { +struct hfa384x_bytestr32 {u16 len;u8 data[32 ]; } __packed hfa384x_bytestr32_t;
@@ -366,14 +366,14 @@ Configuration Record Structures:--------------------------------------------------------------------*/ /*-- Hardware/Firmware Component Information ----------*/ -typedef struct hfa384x_compident { +struct hfa384x_compident {u16 id;u16 variant;u16 major;u16 minor; } __packed hfa384x_compident_t; -typedef struct hfa384x_caplevel { +struct hfa384x_caplevel {u16 role;u16 id;u16 variant;
@@ -394,27 +394,27 @@ Configuration Record Structures:#define HFA384x_CREATEIBSS_JOINCREATEIBSS 0/*-- Configuration Record: HostScanRequest (data portion only) --*/ -typedef struct hfa384x_HostScanRequest_data { +struct hfa384x_HostScanRequest_data {u16 channelList;u16 txRate;hfa384x_bytestr32_t ssid; } __packed hfa384x_HostScanRequest_data_t;/*-- Configuration Record: JoinRequest (data portion only) --*/ -typedef struct hfa384x_JoinRequest_data { +struct hfa384x_JoinRequest_data {u8 bssid[WLAN_BSSID_LEN ];u16 channel; } __packed hfa384x_JoinRequest_data_t;/*-- Configuration Record: authenticateStation (data portion only) --*/ -typedef struct hfa384x_authenticateStation_data { +struct hfa384x_authenticateStation_data {u8 address[ETH_ALEN ];u16 status;u16 algorithm; } __packed hfa384x_authenticateStation_data_t;/*-- Configuration Record: WPAData (data portion only) --*/ -typedef struct hfa384x_WPAData { +struct hfa384x_WPAData {u16 datalen;u8 data[0 ];/* max 80 */ } __packed hfa384x_WPAData_t;
@@ -425,7 +425,7 @@ Information Record Structures: NIC Information/*-- Information Record: DownLoadBuffer --*/ /* NOTE: The page and offset are in AUX format */ -typedef struct hfa384x_downloadbuffer { +struct hfa384x_downloadbuffer {u16 page;u16 offset;u16 len;
@@ -438,14 +438,14 @@ Information Record Structures: NIC Information#define HFA384x_PSTATUS_CONN_IBSS ((u16)3)/*-- Information Record: commsquality --*/ -typedef struct hfa384x_commsquality { +struct hfa384x_commsquality {u16 CQ_currBSS;u16 ASL_currBSS;u16 ANL_currFC; } __packed hfa384x_commsquality_t;/*-- Information Record: dmbcommsquality --*/ -typedef struct hfa384x_dbmcommsquality { +struct hfa384x_dbmcommsquality {u16 CQdbm_currBSS;u16 ASLdbm_currBSS;u16 ANLdbm_currFC;
@@ -457,7 +457,7 @@ FRAME STRUCTURES: Communication FramesCommunication Frames: Transmit Frames --------------------------------------------------------------------*/ /*-- Communication Frame: Transmit Frame Structure --*/ -typedef struct hfa384x_tx_frame { +struct hfa384x_tx_frame {u16 status;u16 reserved1;u16 reserved2;
@@ -519,7 +519,7 @@ Communication Frames: Test/Get/Set Field Values for Transmit FramesCommunication Frames: Receive Frames --------------------------------------------------------------------*/ /*-- Communication Frame: Receive Frame Structure --*/ -typedef struct hfa384x_rx_frame { +struct hfa384x_rx_frame {/*-- MAC rx descriptor (hfa384x byte order) --*/ u16 status;u32 time;
@@ -586,7 +586,7 @@ Information Frames: Notification Frame Structures--------------------------------------------------------------------*/ /*-- Inquiry Frame, Diagnose: Communication Tallies --*/ -typedef struct hfa384x_CommTallies16 { +struct hfa384x_CommTallies16 {u16 txunicastframes;u16 txmulticastframes;u16 txfragments;
Signature · 1 line
1.9.1
Quoted 13 lines · Dilek Uzulmez
This patch fixes "do not add new typedefs"
checkpatch.pl warning inhfa384x.hSigned-off-by Dilek Uzulmez <[email protected]>--- drivers/staging/wlan-ng/hfa384x.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)drivers/staging/wlan-ng/hfa384x.h +0
-0
drivers/staging/wlan-ng/hfa384x.h struct hfa384x_bytestr { · line 361
Quoted 8 lines
drivers/staging/wlan-ng/hfa384x.h +1
-1@@ -355,7 +355,7 @@ struct hfa384x_bytestr {u8 data[0 ]; } __packed; -typedef struct hfa384x_bytestr32 { +struct hfa384x_bytestr32 {u16 len;u8 data[32 ]; } __packed hfa384x_bytestr32_t;
This is not the correct change. The syntax of a typedef is:
typedef type new_typename;
You have changed it to variable declaration syntax:
type variable_name;
That is, you are now declaring hfa384x_bytestr32_t to be a variable. This should cause many compiler errors, if the typedef name was used. To make the change properly, you need to remove typedef and remove the new type name. This leaves only the name next to struct as the name of this type. You should then go around to all of the uses of the typedef and change them to use the struct type.
It may be that the typedef name is nicer than the existing name of the struct type. You can thus use that name instead for the struct type. I this case, it may be good to remove the trailing _t if there is any.
Remember to always compile your code. In the case of a .h file, you can't compile it directly. But you can compile the complete driver that contains it, to get the uses. Be sure that you have .o file for each .c file.
julia
Quoted 112 lines
drivers/staging/wlan-ng/hfa384x.h +12
-13@@ -366,14 +366,14 @@ Configuration Record Structures:--------------------------------------------------------------------*/ /*-- Hardware/Firmware Component Information ----------*/ -typedef struct hfa384x_compident { +struct hfa384x_compident {u16 id;u16 variant;u16 major;u16 minor; } __packed hfa384x_compident_t; -typedef struct hfa384x_caplevel { +struct hfa384x_caplevel {u16 role;u16 id;u16 variant;@@ -394,27 +394,27 @@ Configuration Record Structures:#define HFA384x_CREATEIBSS_JOINCREATEIBSS 0/*-- Configuration Record: HostScanRequest (data portion only) --*/ -typedef struct hfa384x_HostScanRequest_data { +struct hfa384x_HostScanRequest_data {u16 channelList;u16 txRate;hfa384x_bytestr32_t ssid; } __packed hfa384x_HostScanRequest_data_t;/*-- Configuration Record: JoinRequest (data portion only) --*/ -typedef struct hfa384x_JoinRequest_data { +struct hfa384x_JoinRequest_data {u8 bssid[WLAN_BSSID_LEN ];u16 channel; } __packed hfa384x_JoinRequest_data_t;/*-- Configuration Record: authenticateStation (data portion only) --*/ -typedef struct hfa384x_authenticateStation_data { +struct hfa384x_authenticateStation_data {u8 address[ETH_ALEN ];u16 status;u16 algorithm; } __packed hfa384x_authenticateStation_data_t;/*-- Configuration Record: WPAData (data portion only) --*/ -typedef struct hfa384x_WPAData { +struct hfa384x_WPAData {u16 datalen;u8 data[0 ];/* max 80 */ } __packed hfa384x_WPAData_t;@@ -425,7 +425,7 @@ Information Record Structures: NIC Information/*-- Information Record: DownLoadBuffer --*/ /* NOTE: The page and offset are in AUX format */ -typedef struct hfa384x_downloadbuffer { +struct hfa384x_downloadbuffer {u16 page;u16 offset;u16 len;@@ -438,14 +438,14 @@ Information Record Structures: NIC Information#define HFA384x_PSTATUS_CONN_IBSS ((u16)3)/*-- Information Record: commsquality --*/ -typedef struct hfa384x_commsquality { +struct hfa384x_commsquality {u16 CQ_currBSS;u16 ASL_currBSS;u16 ANL_currFC; } __packed hfa384x_commsquality_t;/*-- Information Record: dmbcommsquality --*/ -typedef struct hfa384x_dbmcommsquality { +struct hfa384x_dbmcommsquality {u16 CQdbm_currBSS;u16 ASLdbm_currBSS;u16 ANLdbm_currFC;@@ -457,7 +457,7 @@ FRAME STRUCTURES: Communication FramesCommunication Frames: Transmit Frames --------------------------------------------------------------------*/ /*-- Communication Frame: Transmit Frame Structure --*/ -typedef struct hfa384x_tx_frame { +struct hfa384x_tx_frame {u16 status;u16 reserved1;u16 reserved2;@@ -519,7 +519,7 @@ Communication Frames: Test/Get/Set Field Values for Transmit FramesCommunication Frames: Receive Frames --------------------------------------------------------------------*/ /*-- Communication Frame: Receive Frame Structure --*/ -typedef struct hfa384x_rx_frame { +struct hfa384x_rx_frame {/*-- MAC rx descriptor (hfa384x byte order) --*/ u16 status;u32 time;@@ -586,7 +586,7 @@ Information Frames: Notification Frame Structures--------------------------------------------------------------------*/ /*-- Inquiry Frame, Diagnose: Communication Tallies --*/ -typedef struct hfa384x_CommTallies16 { +struct hfa384x_CommTallies16 {u16 txunicastframes;u16 txmulticastframes;u16 txfragments; --1.9.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1424521123-23632-1-git-send-email-dilekuzulmez%40gmail.com.
For more options, visit https://groups.google.com/d/optout.