Commit 5f8a6c70 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 8a2bcda5 b07bf253
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -161,8 +161,8 @@ int iommufd_viommu_report_event(struct iommufd_viommu *viommu,
		vevent = &veventq->lost_events_header;
		goto out_set_header;
	}
	memcpy(vevent->event_data, event_data, data_len);
	vevent->data_len = data_len;
	memcpy(vevent->event_data, event_data, data_len);
	veventq->num_events++;

out_set_header:
+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 *