[PATCH v2 8/8] staging: r8188eu: check rt_firmware_hdr size at compile time

From: Michael Straube
Date: Thu Apr 14 2022 - 06:44:25 EST


Check the size of struct rt_firmware_hdr at compile time since
we rely on the size to be 32 in rtl8188e_firmware_download().

Suggested-by: David Laight <David.Laight@xxxxxxxxxx>
Signed-off-by: Michael Straube <straube.linux@xxxxxxxxx>
---
drivers/staging/r8188eu/core/rtw_fw.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/staging/r8188eu/core/rtw_fw.c b/drivers/staging/r8188eu/core/rtw_fw.c
index c58bce1a1856..4417375a158d 100644
--- a/drivers/staging/r8188eu/core/rtw_fw.c
+++ b/drivers/staging/r8188eu/core/rtw_fw.c
@@ -34,6 +34,8 @@ struct rt_firmware_hdr {
__le32 rsvd5;
};

+static_assert(sizeof(struct rt_firmware_hdr) == 32);
+
static void fw_download_enable(struct adapter *padapter, bool enable)
{
u8 tmp;
--
2.35.1