summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2018-02-09 22:21:46 +0100
committerLeah Neukirchen <leah@vuxu.org>2018-02-09 22:21:46 +0100
commitc725c69d77fba9466cada018db8673136c6868e9 (patch)
tree1b6fe2900d547d3dbb419affba6b17df19541d14
parent3217fffd0948de9cdf96fb1bcdfb7419baee8620 (diff)
include/linux/log2.h: define PAGE_SHIFT when needed
-rw-r--r--include/linux/log2.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/log2.h b/include/linux/log2.h
index 1f977d60..96f62458 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -12,7 +12,13 @@
#ifndef _TOOLS_LINUX_LOG2_H
#define _TOOLS_LINUX_LOG2_H
+#include <limits.h>
+#ifndef PAGE_SHIFT
+#define PAGE_SHIFT ilog2(PAGE_SIZE)
+#endif
+
#include <linux/bitops.h>
+#include <linux/compiler.h>
/*
* deal with unrepresentable constant logarithms