[PATCH 05/11] staging: wfx: remove useless defines

Jerome Pouiller Jerome.Pouiller at silabs.com
Mon Apr 6 11:17:50 UTC 2020


From: Jérôme Pouiller <jerome.pouiller at silabs.com>

Several values defined in hif API are only here to define length of some
arrays. In most cases, they do not provide any extra information about
the size of the array (ie. "API_FIRMWARE_LABEL_SIZE" is only used to
define the size of member "firmware_label").

Remove these useless definitions.

Signed-off-by: Jérôme Pouiller <jerome.pouiller at silabs.com>
---
 drivers/staging/wfx/hif_api_general.h | 27 +++++++++------------------
 drivers/staging/wfx/hif_api_mib.h     | 11 +++--------
 2 files changed, 12 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h
index 73016135f538..c58b9a1eff3d 100644
--- a/drivers/staging/wfx/hif_api_general.h
+++ b/drivers/staging/wfx/hif_api_general.h
@@ -135,16 +135,11 @@ struct hif_otp_phy_info {
 	u8    otp_phy_ver:2;
 } __packed;
 
-#define API_OPN_SIZE                                    14
-#define API_UID_SIZE                                    8
-#define API_DISABLED_CHANNEL_LIST_SIZE                  2
-#define API_FIRMWARE_LABEL_SIZE                         128
-
 struct hif_ind_startup {
 	u32   status;
 	u16   hardware_id;
-	u8    opn[API_OPN_SIZE];
-	u8    uid[API_UID_SIZE];
+	u8    opn[14];
+	u8    uid[8];
 	u16   num_inp_ch_bufs;
 	u16   size_inp_ch_buf;
 	u8    num_links_ap;
@@ -157,11 +152,11 @@ struct hif_ind_startup {
 	u8    firmware_minor;
 	u8    firmware_major;
 	u8    firmware_type;
-	u8    disabled_channel_list[API_DISABLED_CHANNEL_LIST_SIZE];
+	u8    disabled_channel_list[2];
 	struct hif_otp_regul_sel_mode_info regul_sel_mode_info;
 	struct hif_otp_phy_info otp_phy_info;
 	u32   supported_rate_mask;
-	u8    firmware_label[API_FIRMWARE_LABEL_SIZE];
+	u8    firmware_label[128];
 } __packed;
 
 struct hif_ind_wakeup {
@@ -229,10 +224,8 @@ struct hif_ind_generic {
 } __packed;
 
 
-#define HIF_EXCEPTION_DATA_SIZE            124
-
 struct hif_ind_exception {
-	u8    data[HIF_EXCEPTION_DATA_SIZE];
+	u8    data[124];
 } __packed;
 
 
@@ -302,14 +295,14 @@ struct hif_cnf_set_sl_mac_key {
 	u32   status;
 } __packed;
 
-#define API_HOST_PUB_KEY_SIZE                           32
-#define API_HOST_PUB_KEY_MAC_SIZE                       64
-
 enum hif_sl_session_key_alg {
 	HIF_SL_CURVE25519                                = 0x01,
 	HIF_SL_KDF                                       = 0x02
 };
 
+#define API_HOST_PUB_KEY_SIZE                           32
+#define API_HOST_PUB_KEY_MAC_SIZE                       64
+
 struct hif_req_sl_exchange_pub_keys {
 	u8    algorithm:2;
 	u8    reserved1:6;
@@ -331,10 +324,8 @@ struct hif_ind_sl_exchange_pub_keys {
 	u8    ncp_pub_key_mac[API_NCP_PUB_KEY_MAC_SIZE];
 } __packed;
 
-#define API_ENCR_BMP_SIZE        32
-
 struct hif_req_sl_configure {
-	u8    encr_bmp[API_ENCR_BMP_SIZE];
+	u8    encr_bmp[32];
 	u8    disable_session_key_protection:1;
 	u8    reserved1:7;
 	u8    reserved2[3];
diff --git a/drivers/staging/wfx/hif_api_mib.h b/drivers/staging/wfx/hif_api_mib.h
index 732f82d10a19..e6d05789720c 100644
--- a/drivers/staging/wfx/hif_api_mib.h
+++ b/drivers/staging/wfx/hif_api_mib.h
@@ -149,9 +149,6 @@ struct hif_mib_rx_filter {
 	u8    reserved4[3];
 } __packed;
 
-#define HIF_API_OUI_SIZE                                3
-#define HIF_API_MATCH_DATA_SIZE                         3
-
 struct hif_ie_table_entry {
 	u8    ie_id;
 	u8    has_changed:1;
@@ -159,8 +156,8 @@ struct hif_ie_table_entry {
 	u8    has_appeared:1;
 	u8    reserved:1;
 	u8    num_match_data:4;
-	u8    oui[HIF_API_OUI_SIZE];
-	u8    match_data[HIF_API_MATCH_DATA_SIZE];
+	u8    oui[3];
+	u8    match_data[3];
 } __packed;
 
 struct hif_mib_bcn_filter_table {
@@ -273,14 +270,12 @@ enum hif_tmplt {
 	HIF_TMPLT_NA                               = 0x7
 };
 
-#define HIF_API_MAX_TEMPLATE_FRAME_SIZE                              700
-
 struct hif_mib_template_frame {
 	u8    frame_type;
 	u8    init_rate:7;
 	u8    mode:1;
 	u16   frame_length;
-	u8    frame[HIF_API_MAX_TEMPLATE_FRAME_SIZE];
+	u8    frame[700];
 } __packed;
 
 struct hif_mib_beacon_wake_up_period {
-- 
2.25.1



More information about the devel mailing list