Skip to content

Commit fb22a29

Browse files
committed
iommufd/iommufd_private.h: Avoid -Wflex-array-member-not-at-end warning
JIRA: https://issues.redhat.com/browse/RHEL-131315 Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git commit b07bf25 Author: Gustavo A. R. Silva <gustavoars@kernel.org> Date: Mon Nov 10 20:35:31 2025 +0900 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: "Gustavo A. R. Silva" <gustavoars@kernel.org> Fixes: e36ba5a ("iommufd: Add IOMMUFD_OBJ_VEVENTQ and IOMMUFD_CMD_VEVENTQ_ALLOC") Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Eder Zulian <ezulian@redhat.com>
1 parent 2ed48eb commit fb22a29

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/iommu/iommufd/iommufd_private.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,14 +614,16 @@ struct iommufd_veventq {
614614
struct iommufd_eventq common;
615615
struct iommufd_viommu *viommu;
616616
struct list_head node; /* for iommufd_viommu::veventqs */
617-
struct iommufd_vevent lost_events_header;
618617

619618
enum iommu_veventq_type type;
620619
unsigned int depth;
621620

622621
/* Use common.lock for protection */
623622
u32 num_events;
624623
u32 sequence;
624+
625+
/* Must be last as it ends in a flexible-array member. */
626+
struct iommufd_vevent lost_events_header;
625627
};
626628

627629
static inline struct iommufd_veventq *

0 commit comments

Comments
 (0)