summaryrefslogtreecommitdiff
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index a890428bcc1a..08ba5995aa8b 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -64,6 +64,15 @@
)
/**
+ * lower_48_bits() - return bits 0-47 of a number
+ * @n: the number we're accessing
+ */
+static inline u64 lower_48_bits(u64 n)
+{
+ return n & ((1ull << 48) - 1);
+}
+
+/**
* upper_32_bits - return bits 32-63 of a number
* @n: the number we're accessing
*