diff options
author | Yao Xingtao <yaoxt.fnst@fujitsu.com> | 2024-07-22 00:07:30 -0400 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-07-23 20:30:36 +0200 |
commit | 007643bddcebf9e7fb8460a4e8068c4f80afa17e (patch) | |
tree | 62e3132c320c5d91906be565581c03e616384c39 | |
parent | c8f1a322d1f8c15f72cc57e469d2331a2d84da63 (diff) | |
download | qemu-007643bddcebf9e7fb8460a4e8068c4f80afa17e.zip qemu-007643bddcebf9e7fb8460a4e8068c4f80afa17e.tar.gz qemu-007643bddcebf9e7fb8460a4e8068c4f80afa17e.tar.bz2 |
util/range: Make ranges_overlap() return bool
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>
-rw-r--r-- | include/qemu/range.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/qemu/range.h b/include/qemu/range.h index 4ce694a..d446ad8 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); |