Skip to content

Commit b07bf25

Browse files
GustavoARSilvajgunthorpe
authored andcommitted
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" <[email protected]> Fixes: e36ba5a ("iommufd: Add IOMMUFD_OBJ_VEVENTQ and IOMMUFD_CMD_VEVENTQ_ALLOC") Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Nicolin Chen <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent ac84ff4 commit b07bf25

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)