diff mbox series

[PULL,12/28] util/range: Make ranges_overlap() return bool

Message ID 20240723203855.65033-13-philmd@linaro.org (mailing list archive)
State New, archived
Headers show
Series [PULL,01/28] accel: Restrict probe_access*() functions to TCG | expand

Commit Message

Philippe Mathieu-Daudé July 23, 2024, 8:38 p.m. UTC
From: Yao Xingtao <yaoxt.fnst@fujitsu.com>

Just like range_overlaps_range(), use the returned bool value
to check whether 2 given ranges overlap.

Signed-off-by: Yao Xingtao <yaoxt.fnst@fujitsu.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240722040742.11513-2-yaoxt.fnst@fujitsu.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/qemu/range.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/qemu/range.h b/include/qemu/range.h
index 4ce694a3983..d446ad885d2 100644
--- a/include/qemu/range.h
+++ b/include/qemu/range.h
@@ -210,8 +210,8 @@  static inline int range_covers_byte(uint64_t offset, uint64_t len,
 
 /* Check whether 2 given ranges overlap.
  * Undefined if ranges that wrap around 0. */
-static inline int ranges_overlap(uint64_t first1, uint64_t len1,
-                                 uint64_t first2, uint64_t len2)
+static inline bool ranges_overlap(uint64_t first1, uint64_t len1,
+                                  uint64_t first2, uint64_t len2)
 {
     uint64_t last1 = range_get_last(first1, len1);
     uint64_t last2 = range_get_last(first2, len2);