linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] wifi: rtl8xxxu: Avoid -Wflex-array-member-not-at-end warnings
@ 2025-11-19  9:08 Gustavo A. R. Silva
  2025-11-21  6:09 ` Ping-Ke Shih
  2025-11-21 10:06 ` Zenm Chen
  0 siblings, 2 replies; 15+ messages in thread
From: Gustavo A. R. Silva @ 2025-11-19  9:08 UTC (permalink / raw)
  To: Jes Sorensen
  Cc: linux-wireless, linux-kernel, Gustavo A. R. Silva,
	linux-hardening

-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.

Move the conflicting declarations to the end of the corresponding
structures. Notice that `struct urb` is a flexible structure, this
is a structure that contains a flexible-array member.

With these changes fix the following warnings:

9 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h:1951:20: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
9 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h:1945:20: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index f42463e595cc..48b598b06523 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -1942,15 +1942,19 @@ struct rtl8xxxu_vif {
 };
 
 struct rtl8xxxu_rx_urb {
-	struct urb urb;
 	struct ieee80211_hw *hw;
 	struct list_head list;
+
+	/* Must be last as it ends in a flexible-array member. */
+	struct urb urb;
 };
 
 struct rtl8xxxu_tx_urb {
-	struct urb urb;
 	struct ieee80211_hw *hw;
 	struct list_head list;
+
+	/* Must be last as it ends in a flexible-array member. */
+	struct urb urb;
 };
 
 struct rtl8xxxu_fileops {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-12-08  0:05 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19  9:08 [PATCH][next] wifi: rtl8xxxu: Avoid -Wflex-array-member-not-at-end warnings Gustavo A. R. Silva
2025-11-21  6:09 ` Ping-Ke Shih
2025-11-21 10:06 ` Zenm Chen
2025-11-21 10:19   ` Gustavo A. R. Silva
2025-11-21 11:11     ` Zenm Chen
2025-11-23 20:29       ` Bitterblue Smith
2025-11-24  6:37         ` Ping-Ke Shih
2025-11-24  8:02           ` Zenm Chen
2025-11-26  3:26         ` Ping-Ke Shih
2025-12-06 21:53           ` Bitterblue Smith
2025-12-06 23:16             ` Michal Pecio
2025-12-06 23:55               ` Greg KH
2025-12-07  8:05                 ` Michal Pecio
2025-12-08  0:05               ` Bitterblue Smith
2025-11-21 11:12     ` Ping-Ke Shih

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).