projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8198375
)
kernel/range: Const-ify range_contains parameters
author
Ira Weiny
<ira.weiny@intel.com>
Thu, 10 Oct 2024 15:24:42 +0000
(10:24 -0500)
committer
Dave Jiang
<dave.jiang@intel.com>
Mon, 28 Oct 2024 17:06:51 +0000
(10:06 -0700)
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/20241008161032.GB1609@twin.jikos.cz/
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Link:
https://patch.msgid.link/20241010-const-range-v1-1-afb6e4bfd8ce@intel.com
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
include/linux/range.h
patch
|
blob
|
history
diff --git
a/include/linux/range.h
b/include/linux/range.h
index
6ad0b73
..
7dc5e83
100644
(file)
--- 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;
}