kernel/range: Const-ify range_contains parameters
PATCH 1/1 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
--- include/linux/range.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/range.h +2 -1
@@ -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; }
---
base-commit: 27cc6fdf720183dce1dbd293483ec5a9cb6b595e
change-id: 20241009-const-range-35475803a824
Best regards,
Signature · 1 line
Ira Weiny <[email protected]>
Quoted 8 lines · Ira Weiny
range_contains()does not modify the range values. David suggested it is safer to keep those parameters as const.[1]Make range parameters const
Suggested-by David Sterba <[email protected]>Signed-off-by Ira Weiny <[email protected]>
LGTM
Quoted 7 lines · Ira Weiny
range_contains()does not modify the range values. David suggested it is safer to keep those parameters as const.[1]Make range parameters const
Suggested-by David Sterba <[email protected]>
You can drop the above line.
Quoted 1 line
Signed-off-by Ira Weiny <[email protected]>
Ira Weiny
AppliedQuoted 10 lines · David Sterba
Quoted 7 lines · Ira Weiny
range_contains()does not modify the range values. David suggested it is safer to keep those parameters as const.[1]Make range parameters const
Suggested-by David Sterba <[email protected]>You can drop the above line.
Done.
Quoted 4 lines
Quoted 2 lines
Signed-off-by Ira Weiny <[email protected]>Reviewed-by David Sterba <[email protected]>
Queued in the cxl-next tree.
Thanks!
Ira