* [PATCH] rtw88: mark rtw_fw_hdr __packed
@ 2019-10-14 21:26 Brian Norris
2019-10-16 7:35 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Brian Norris @ 2019-10-14 21:26 UTC (permalink / raw)
To: linux-wireless; +Cc: Yan-Hsuan Chuang, Brian Norris, Ping-Ke Shih
The use of u8 and __le16 in this struct assumes that it's going to be
packed to byte alignment. C doesn't guarantee that, so we should mark
this __packed.
Fixes: cc20a7139836 ("rtw88: use struct rtw_fw_hdr to access firmware header")
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
drivers/net/wireless/realtek/rtw88/fw.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtw88/fw.h b/drivers/net/wireless/realtek/rtw88/fw.h
index 4f7999394235..73d1b9ca8efc 100644
--- a/drivers/net/wireless/realtek/rtw88/fw.h
+++ b/drivers/net/wireless/realtek/rtw88/fw.h
@@ -127,7 +127,7 @@ struct rtw_fw_hdr {
__le32 emem_size;
__le32 emem_addr;
__le32 imem_addr;
-};
+} __packed;
/* C2H */
#define GET_CCX_REPORT_SEQNUM(c2h_payload) (c2h_payload[8] & 0xfc)
--
2.23.0.700.g56cf767bdb-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rtw88: mark rtw_fw_hdr __packed
2019-10-14 21:26 [PATCH] rtw88: mark rtw_fw_hdr __packed Brian Norris
@ 2019-10-16 7:35 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2019-10-16 7:35 UTC (permalink / raw)
To: Brian Norris; +Cc: linux-wireless, Yan-Hsuan Chuang, Brian Norris, Ping-Ke Shih
Brian Norris <briannorris@chromium.org> wrote:
> The use of u8 and __le16 in this struct assumes that it's going to be
> packed to byte alignment. C doesn't guarantee that, so we should mark
> this __packed.
>
> Fixes: cc20a7139836 ("rtw88: use struct rtw_fw_hdr to access firmware header")
> Cc: Ping-Ke Shih <pkshih@realtek.com>
> Signed-off-by: Brian Norris <briannorris@chromium.org>
Patch applied to wireless-drivers-next.git, thanks.
89dca86d29b4 rtw88: mark rtw_fw_hdr __packed
--
https://patchwork.kernel.org/patch/11189429/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-16 7:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-14 21:26 [PATCH] rtw88: mark rtw_fw_hdr __packed Brian Norris
2019-10-16 7:35 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).