[PATCH 12/27] range.h: Make range_contains() take const struct range * as parameter type

From: Zijun Hu
Date: Sat Aug 10 2024 - 22:27:55 EST


From: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>

Make range_contains() take const struct range * as parameter type since
it does not modify these caller's ranges.

Signed-off-by: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
---
include/linux/range.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/range.h b/include/linux/range.h
index 6ad0b73cb7ad..7dc5e835e079 100644
--- a/include/linux/range.h
+++ b/include/linux/range.h
@@ -13,7 +13,8 @@ static inline u64 range_len(const struct range *range)
return range->end - range->start + 1;
}

-static inline bool range_contains(struct range *r1, struct range *r2)
+static inline bool range_contains(const struct range *r1,
+ const struct range *r2)
{
return r1->start <= r2->start && r1->end >= r2->end;
}

--
2.34.1