From: "Greenman, Gregory" <gregory.greenman@intel.com>
To: "kvalo@kernel.org" <kvalo@kernel.org>,
"arnd@kernel.org" <arnd@kernel.org>,
"shahar.s.matityahu@intel.com" <shahar.s.matityahu@intel.com>,
"Coelho, Luciano" <luciano.coelho@intel.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"Berg, Johannes" <johannes.berg@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"arnd@arndb.de" <arnd@arndb.de>,
"Sisodiya, Mukesh" <mukesh.sisodiya@intel.com>
Subject: Re: [PATCH] iwlwifi: dbg_ini: fix structure packing
Date: Mon, 28 Aug 2023 12:46:31 +0000 [thread overview]
Message-ID: <96166c759e97d23014c0d0bf86299eb132633493.camel@intel.com> (raw)
In-Reply-To: <20230616090343.2454061-1-arnd@kernel.org>
On Fri, 2023-06-16 at 11:03 +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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: 973193554cae6 ("iwlwifi: dbg_ini: dump headers cleanup")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/net/wireless/intel/iwlwifi/fw/error-dump.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/intel/iwlwifi/fw/error-dump.h b/drivers/net/wireless/intel/iwlwifi/fw/error-dump.h
> index f5e08988dc7bf..06d6f7f664308 100644
> --- a/drivers/net/wireless/intel/iwlwifi/fw/error-dump.h
> +++ b/drivers/net/wireless/intel/iwlwifi/fw/error-dump.h
> @@ -310,9 +310,9 @@ struct iwl_fw_ini_fifo_hdr {
> struct iwl_fw_ini_error_dump_range {
> __le32 range_data_size;
> union {
> - __le32 internal_base_addr;
> - __le64 dram_base_addr;
> - __le32 page_num;
> + __le32 internal_base_addr __packed;
> + __le64 dram_base_addr __packed;
> + __le32 page_num __packed;
> struct iwl_fw_ini_fifo_hdr fifo_hdr;
> struct iwl_cmd_header fw_pkt_hdr;
> };
Acked-by: Gregory Greenman <gregory.greenman@intel.com>
prev parent reply other threads:[~2023-08-28 12:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-16 9:03 [PATCH] iwlwifi: dbg_ini: fix structure packing Arnd Bergmann
2023-08-14 18:28 ` Johannes Berg
2023-08-14 21:02 ` Arnd Bergmann
2023-08-28 12:46 ` Greenman, Gregory [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=96166c759e97d23014c0d0bf86299eb132633493.camel@intel.com \
--to=gregory.greenman@intel.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=johannes.berg@intel.com \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luciano.coelho@intel.com \
--cc=mukesh.sisodiya@intel.com \
--cc=shahar.s.matityahu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox