Skip to content

Commit 6641868

Browse files
weiny2davejiang
authored andcommitted
kernel/range: Const-ify range_contains parameters
range_contains() does not modify the range values. David suggested it is safer to keep those parameters as const.[1] Make range parameters const Link: https://lore.kernel.org/all/[email protected]/ [1] Reviewed-by: Dan Williams <[email protected]> Reviewed-by: David Sterba <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Ira Weiny <[email protected]> Signed-off-by: Dave Jiang <[email protected]>
1 parent 8198375 commit 6641868

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/linux/range.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ static inline u64 range_len(const struct range *range)
1313
return range->end - range->start + 1;
1414
}
1515

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

0 commit comments

Comments
 (0)