Commit 424c82e8 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Johannes Berg

wifi: iwlwifi: dbg_ini: fix structure packing

The iwl_fw_ini_error_dump_range structure has conflicting alignment
requirements for the inner union and the outer struct:

In file included from drivers/net/wireless/intel/iwlwifi/fw/dbg.c:9:
drivers/net/wireless/intel/iwlwifi/fw/error-dump.h:312:2: error: field  within 'struct iwl_fw_ini_error_dump_range' is less aligned than 'union iwl_fw_ini_error_dump_range::(anonymous at drivers/net/wireless/intel/iwlwifi/fw/error-dump.h:312:2)' and is usually due to 'struct iwl_fw_ini_error_dump_range' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access]
        union {

As the original intention was apparently to make the entire structure
unaligned, mark the innermost members the same way so the union
becomes packed as well.

Fixes: 97319355 ("iwlwifi: dbg_ini: dump headers cleanup")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230616090343.2454061-1-arnd@kernel.orgSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 2d4caa1d
...@@ -310,9 +310,9 @@ struct iwl_fw_ini_fifo_hdr { ...@@ -310,9 +310,9 @@ struct iwl_fw_ini_fifo_hdr {
struct iwl_fw_ini_error_dump_range { struct iwl_fw_ini_error_dump_range {
__le32 range_data_size; __le32 range_data_size;
union { union {
__le32 internal_base_addr; __le32 internal_base_addr __packed;
__le64 dram_base_addr; __le64 dram_base_addr __packed;
__le32 page_num; __le32 page_num __packed;
struct iwl_fw_ini_fifo_hdr fifo_hdr; struct iwl_fw_ini_fifo_hdr fifo_hdr;
struct iwl_cmd_header fw_pkt_hdr; struct iwl_cmd_header fw_pkt_hdr;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment