datapath: Backport DIV_ROUND_UP.
authorJesse Gross <jesse@nicira.com>
Thu, 14 Apr 2011 20:10:09 +0000 (13:10 -0700)
committerJesse Gross <jesse@nicira.com>
Wed, 27 Apr 2011 19:29:06 +0000 (12:29 -0700)
Older kernels didn't define DIV_ROUND_UP, so this provides a
backported version.

Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/linux-2.6/compat-2.6/include/linux/kernel.h

index 2c2220b9f0b3fb73d69c837bc542944c1a2823cb..4af88516edd7ba65f1099078e1b32ea4a3ae76da 100644 (file)
@@ -54,4 +54,8 @@
 #define SHRT_MIN       ((s16)(-SHRT_MAX - 1))
 #endif
 
+#ifndef DIV_ROUND_UP
+#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
+#endif
+
 #endif /* linux/kernel.h */