aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/range.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/range.h')
-rw-r--r--include/linux/range.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/range.h b/include/linux/range.h
index d1fbeb664012..274681cc3154 100644
--- a/include/linux/range.h
+++ b/include/linux/range.h
@@ -1,12 +1,18 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_RANGE_H
#define _LINUX_RANGE_H
+#include <linux/types.h>
struct range {
u64 start;
u64 end;
};
+static inline u64 range_len(const struct range *range)
+{
+ return range->end - range->start + 1;
+}
+
int add_range(struct range *range, int az, int nr_range,
u64 start, u64 end);