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

Zijun Hu posted 27 patches 1 year, 6 months ago
[PATCH 12/27] range.h: Make range_contains() take const struct range * as parameter type
Posted by Zijun Hu 1 year, 6 months ago
From: Zijun Hu <quic_zijuhu@quicinc.com>

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@quicinc.com>
---
 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