Skip to content

Commit 5f8a6c7

Browse files
committed
Merge tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd
Pull iommufd fixes from Jason Gunthorpe: "Two build fixes, no functional change: - Fix a possible compiler error around counted_by() due to wrong initialization order - Fix a -Wflex-array-member-not-at-end" * tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd: iommufd/iommufd_private.h: Avoid -Wflex-array-member-not-at-end warning iommufd/driver: Fix counter initialization for counted_by annotation
2 parents 8a2bcda + b07bf25 commit 5f8a6c7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/iommu/iommufd/driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ int iommufd_viommu_report_event(struct iommufd_viommu *viommu,
161161
vevent = &veventq->lost_events_header;
162162
goto out_set_header;
163163
}
164-
memcpy(vevent->event_data, event_data, data_len);
165164
vevent->data_len = data_len;
165+
memcpy(vevent->event_data, event_data, data_len);
166166
veventq->num_events++;
167167

168168
out_set_header:

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)