summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-02-27 14:47:26 +0100
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-03-09 01:40:19 +0100
commitc1549925c561ccf4f1ce5ffd7ba7ddca9b5da53c (patch)
tree1007692c696683c64d566828d14077526f937a49
parent1b216d755596926881a56e9e03b7c3a8100011ff (diff)
linux/kernel.h: sync DIV_ROUND_UP_ULL from kernel
The DIV_ROUND_UP_ULL is required for porting the sunxi clock (CCU) binding from linux.
-rw-r--r--include/linux/kernel.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 0b616713cc..dc3f36a520 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -56,6 +56,8 @@
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
+#define DIV_ROUND_UP_ULL(ll,d) \
+ ({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; })
#if BITS_PER_LONG == 32
# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP_ULL(ll, d)