summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Whitehouse2006-09-26 08:32:40 +0200
committerLinus Torvalds2006-09-26 17:48:58 +0200
commit930631edd4b1fe2781d9fe90edbe35d89dfc94cc (patch)
tree24341082c9043742e45f7865f54ad3223e2fd89e
parent[PATCH] alpha: Fix ALPHA_EV56 dependencies typo (diff)
downloadkernel-qcow2-linux-930631edd4b1fe2781d9fe90edbe35d89dfc94cc.tar.gz
kernel-qcow2-linux-930631edd4b1fe2781d9fe90edbe35d89dfc94cc.tar.xz
kernel-qcow2-linux-930631edd4b1fe2781d9fe90edbe35d89dfc94cc.zip
[PATCH] add DIV_ROUND_UP()
Add the DIV_ROUND_UP() helper macro: divide `n' by `d', rounding up. Stolen from the gfs2 tree(!) because the swsusp patches need it. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--include/linux/kernel.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 2b2ae4fdce8b..e44a37e2c71c 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -33,6 +33,7 @@ extern const char linux_banner[];
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#define ALIGN(x,a) (((x)+(a)-1UL)&~((a)-1UL))
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
+#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
#define KERN_EMERG "<0>" /* system is unusable */