[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/13] range: Make range_compare() public
From: |
Eric Auger |
Subject: |
[PATCH 08/13] range: Make range_compare() public |
Date: |
Mon, 4 Sep 2023 10:03:51 +0200 |
Let's expose range_compare() in the header so that it can be
reused outside of util/range.c
Signed-off-by: Eric Auger <eric.auger@redhat.com>
---
include/qemu/range.h | 6 ++++++
util/range.c | 6 +-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/include/qemu/range.h b/include/qemu/range.h
index fc1d3dabe6..52641dfb79 100644
--- a/include/qemu/range.h
+++ b/include/qemu/range.h
@@ -217,6 +217,12 @@ static inline int ranges_overlap(uint64_t first1, uint64_t
len1,
return !(last2 < first1 || last1 < first2);
}
+/*
+ * Return -1 if @a < @b, 1 @a > @b, and 0 if they touch or overlap.
+ * Both @a and @b must not be empty.
+ */
+int range_compare(Range *a, Range *b);
+
GList *range_list_insert(GList *list, Range *data);
void range_inverse_array(uint32_t nr_ranges, Range *ranges,
diff --git a/util/range.c b/util/range.c
index 11c4ff0b78..1fc399e88f 100644
--- a/util/range.c
+++ b/util/range.c
@@ -20,11 +20,7 @@
#include "qemu/osdep.h"
#include "qemu/range.h"
-/*
- * Return -1 if @a < @b, 1 @a > @b, and 0 if they touch or overlap.
- * Both @a and @b must not be empty.
- */
-static inline int range_compare(Range *a, Range *b)
+int range_compare(Range *a, Range *b)
{
assert(!range_is_empty(a) && !range_is_empty(b));
--
2.41.0
- [PATCH 04/13] virtio-iommu: Rename reserved_regions into prop_resv_regions, (continued)
- [PATCH 04/13] virtio-iommu: Rename reserved_regions into prop_resv_regions, Eric Auger, 2023/09/04
- [PATCH 03/13] vfio: Collect container iova range info, Eric Auger, 2023/09/04
- [PATCH 05/13] virtio-iommu: Introduce per IOMMUDevice reserved regions, Eric Auger, 2023/09/04
- [PATCH 06/13] range: Introduce range_inverse_array(), Eric Auger, 2023/09/04
- [PATCH 09/13] util/reserved-region: Add new ReservedRegion helpers, Eric Auger, 2023/09/04
- [PATCH 07/13] virtio-iommu: Implement set_iova_ranges() callback, Eric Auger, 2023/09/04
- [PATCH 11/13] test: Add some tests for range and resv-mem helpers, Eric Auger, 2023/09/04
- [PATCH 13/13] vfio: Remove 64-bit IOVA address space assumption, Eric Auger, 2023/09/04
- [PATCH 08/13] range: Make range_compare() public,
Eric Auger <=
- [PATCH 12/13] virtio-iommu: Resize memory region according to the max iova info, Eric Auger, 2023/09/04
- [PATCH 10/13] virtio-iommu: Consolidate host reserved regions and property set ones, Eric Auger, 2023/09/04
- Re: [PATCH 00/13] VIRTIO-IOMMU/VFIO: Don't assume 64b IOVA space, YangHang Liu, 2023/09/05
- Re: [PATCH 00/13] VIRTIO-IOMMU/VFIO: Don't assume 64b IOVA space, Alex Williamson, 2023/09/05