Commit b07bf253 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Jason Gunthorpe
Browse files

iommufd/iommufd_private.h: Avoid -Wflex-array-member-not-at-end warning

-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]

Link: https://patch.msgid.link/r/aRHOAwpATIE0oajj@kspp


Signed-off-by: default avatar"Gustavo A. R. Silva" <gustavoars@kernel.org>
Fixes: e36ba5ab ("iommufd: Add IOMMUFD_OBJ_VEVENTQ and IOMMUFD_CMD_VEVENTQ_ALLOC")
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Reviewed-by: default avatarNicolin Chen <nicolinc@nvidia.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent ac84ff45
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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 *