diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2022-02-16 13:50:15 -0600 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2022-04-06 10:18:08 +0300 |
commit | 34e63cd5ba29fb832f3fe31e37cea28027979c1d (patch) | |
tree | 7cef488de987450054ff9f5748c17dfccb6b8fb8 /drivers/net/wireless/intel/iwlwifi/fw/file.h | |
parent | 0b5c21bbc01e92745ca1ca4f6fd87d878fa3ea5e (diff) | |
download | linux-34e63cd5ba29fb832f3fe31e37cea28027979c1d.tar.gz linux-34e63cd5ba29fb832f3fe31e37cea28027979c1d.tar.bz2 linux-34e63cd5ba29fb832f3fe31e37cea28027979c1d.zip |
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: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220216195015.GA904148@embeddedor
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/fw/file.h')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/file.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h index 5679a78758be..a7817d952022 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/file.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h @@ -145,7 +145,7 @@ struct iwl_tlv_ucode_header { * Note that each TLV is padded to a length * that is a multiple of 4 for alignment. */ - u8 data[0]; + u8 data[]; }; /* @@ -603,7 +603,7 @@ struct iwl_fw_dbg_dest_tlv_v1 { __le32 wrap_count; u8 base_shift; u8 end_shift; - struct iwl_fw_dbg_reg_op reg_ops[0]; + struct iwl_fw_dbg_reg_op reg_ops[]; } __packed; /* Mask of the register for defining the LDBG MAC2SMEM buffer SMEM size */ @@ -623,14 +623,14 @@ struct iwl_fw_dbg_dest_tlv { __le32 wrap_count; u8 base_shift; u8 size_shift; - struct iwl_fw_dbg_reg_op reg_ops[0]; + struct iwl_fw_dbg_reg_op reg_ops[]; } __packed; struct iwl_fw_dbg_conf_hcmd { u8 id; u8 reserved; __le16 len; - u8 data[0]; + u8 data[]; } __packed; /** @@ -705,7 +705,7 @@ struct iwl_fw_dbg_trigger_tlv { u8 flags; u8 reserved[5]; - u8 data[0]; + u8 data[]; } __packed; #define FW_DBG_START_FROM_ALIVE 0 |