iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] iommufd/iommufd_private.h: Avoid -Wflex-array-member-not-at-end warning
@ 2025-11-10 11:35 Gustavo A. R. Silva
  2025-11-10 18:02 ` Nicolin Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Gustavo A. R. Silva @ 2025-11-10 11:35 UTC (permalink / raw)
  To: Jason Gunthorpe, Kevin Tian, Joerg Roedel, Will Deacon,
	Robin Murphy
  Cc: iommu, 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 declaration to the end of the corresponding
structure. Notice that struct iommufd_vevent is a flexible
structure, this is a structure that contains a flexible-array
member.

Fix the following warning:

drivers/iommu/iommufd/iommufd_private.h:621:31: 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/iommu/iommufd/iommufd_private.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/iommufd/iommufd_private.h b/drivers/iommu/iommufd/iommufd_private.h
index 627f9b78483a..85d0843ed07b 100644
--- a/drivers/iommu/iommufd/iommufd_private.h
+++ b/drivers/iommu/iommufd/iommufd_private.h
@@ -614,7 +614,6 @@ struct iommufd_veventq {
 	struct iommufd_eventq common;
 	struct iommufd_viommu *viommu;
 	struct list_head node; /* for iommufd_viommu::veventqs */
-	struct iommufd_vevent lost_events_header;
 
 	enum iommu_veventq_type type;
 	unsigned int depth;
@@ -622,6 +621,9 @@ struct iommufd_veventq {
 	/* Use common.lock for protection */
 	u32 num_events;
 	u32 sequence;
+
+	/* Must be last as it ends in a flexible-array member. */
+	struct iommufd_vevent lost_events_header;
 };
 
 static inline struct iommufd_veventq *
-- 
2.43.0


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

end of thread, other threads:[~2025-11-21 19:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-10 11:35 [PATCH][next] iommufd/iommufd_private.h: Avoid -Wflex-array-member-not-at-end warning Gustavo A. R. Silva
2025-11-10 18:02 ` Nicolin Chen
2025-11-11  7:20   ` Gustavo A. R. Silva
2025-11-11  8:49     ` Gustavo A. R. Silva
2025-11-11 18:58       ` Nicolin Chen
2025-11-17  7:13 ` Tian, Kevin
2025-11-21 19:41 ` Jason Gunthorpe

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