Commit 34e63cd5 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Kalle Valo
Browse files

iwlwifi: fw: Replace zero-length arrays with flexible-array members

There is a regular need in the kernel to provide a way to declare
having a dynamically sized set of trailing elements in a structure.
Kernel code should always use “flexible array members”[1] for these
cases. The older style of one-element or zero-length arrays should
no longer be used[2].

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays

Link: https://github.com/KSPP/linux/issues/78


Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220216195015.GA904148@embeddedor
parent 0b5c21bb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ struct iwl_fw_ini_hcmd {
	u8 id;
	u8 group;
	__le16 reserved;
	u8 data[0];
	u8 data[];
} __packed; /* FW_DEBUG_TLV_HCMD_DATA_API_S_VER_1 */

/**
@@ -275,7 +275,7 @@ struct iwl_fw_ini_conf_set_tlv {
	__le32 time_point;
	__le32 set_type;
	__le32 addr_offset;
	struct iwl_fw_ini_addr_val addr_val[0];
	struct iwl_fw_ini_addr_val addr_val[];
} __packed; /* FW_TLV_DEBUG_CONFIG_SET_API_S_VER_1 */

/**
+2 −2
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ struct iwl_mfu_assert_dump_notif {
	__le16   index_num;
	__le16   parts_num;
	__le32   data_size;
	__le32   data[0];
	__le32   data[];
} __packed; /* MFU_DUMP_ASSERT_API_S_VER_1 */

/**
@@ -276,7 +276,7 @@ struct iwl_mvm_marker {
	u8 marker_id;
	__le16 reserved;
	__le64 timestamp;
	__le32 metadata[0];
	__le32 metadata[];
} __packed; /* MARKER_API_S_VER_1 */

/**
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ struct iwl_mcast_filter_cmd {
	u8 pass_all;
	u8 bssid[6];
	u8 reserved[2];
	u8 addr_list[0];
	u8 addr_list[];
} __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */

#endif /* __iwl_fw_api_filter_h__ */
+2 −2
Original line number Diff line number Diff line
@@ -1165,7 +1165,7 @@ struct iwl_scan_offload_profiles_query_v1 {
	u8 resume_while_scanning;
	u8 self_recovery;
	__le16 reserved;
	struct iwl_scan_offload_profile_match_v1 matches[0];
	struct iwl_scan_offload_profile_match_v1 matches[];
} __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_2 */

/**
@@ -1209,7 +1209,7 @@ struct iwl_scan_offload_profiles_query {
	u8 resume_while_scanning;
	u8 self_recovery;
	__le16 reserved;
	struct iwl_scan_offload_profile_match matches[0];
	struct iwl_scan_offload_profile_match matches[];
} __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_3 */

/**
+1 −1
Original line number Diff line number Diff line
@@ -477,7 +477,7 @@ struct iwl_mvm_wep_key_cmd {
	u8 decryption_type;
	u8 flags;
	u8 reserved;
	struct iwl_mvm_wep_key wep_key[0];
	struct iwl_mvm_wep_key wep_key[];
} __packed; /* SEC_CURR_WEP_KEY_CMD_API_S_VER_2 */

/**
Loading