summaryrefslogtreecommitdiff
path: root/include/linux/range.h
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2024-11-08 09:50:07 -0700
committerDave Jiang <dave.jiang@intel.com>2024-11-08 09:50:07 -0700
commita83383e2ae7c499ff7b318945d9b2fe4e3006c2c (patch)
tree157942e3ef0d7330fa2f1a0de84cf147c909dbc6 /include/linux/range.h
parent86bcd81d66d63c549e98c9c502ccd3be01a52fe2 (diff)
parenta90326c76bd684bdf0a4f2842ff987ad5c77ff11 (diff)
Merge branch 'cxl/for-6.13/dcd-prep' into cxl-for-next
Add preparation patches for coming soon DCD changes. - Add range_overlaps() - Add CDAT/DSMAS shared and read only flag in ACPICA - Add documentation to struct dev_dax_range - Delay event buffer allocation in CXL PCI - Use guard() in cxl_dpa_set_mode() - Refactor common create region code to reduce redudant code
Diffstat (limited to 'include/linux/range.h')
-rw-r--r--include/linux/range.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/range.h b/include/linux/range.h
index 732c7fdbfd30..d7f98e1285d7 100644
--- a/include/linux/range.h
+++ b/include/linux/range.h
@@ -13,12 +13,20 @@ static inline u64 range_len(const struct range *range)
return range->end - range->start + 1;
}
+/* True if r1 completely contains r2 */
static inline bool range_contains(const struct range *r1,
const struct range *r2)
{
return r1->start <= r2->start && r1->end >= r2->end;
}
+/* True if any part of r1 overlaps r2 */
+static inline bool range_overlaps(const struct range *r1,
+ const struct range *r2)
+{
+ return r1->start <= r2->end && r1->end >= r2->start;
+}
+
int add_range(struct range *range, int az, int nr_range,
u64 start, u64 end);