
From: Ryan Cumming <ryan@spitfire.gotdns.org>



Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/include/linux/kernel.h |    5 +++++
 1 files changed, 5 insertions(+)

diff -puN include/linux/kernel.h~roundup-pow-two include/linux/kernel.h
--- 25/include/linux/kernel.h~roundup-pow-two	Mon Sep 20 14:37:27 2004
+++ 25-akpm/include/linux/kernel.h	Mon Sep 20 14:37:27 2004
@@ -12,6 +12,7 @@
 #include <linux/stddef.h>
 #include <linux/types.h>
 #include <linux/compiler.h>
+#include <linux/bitops.h>
 #include <asm/byteorder.h>
 #include <asm/bug.h>
 
@@ -111,6 +112,10 @@ static inline int __attribute_pure__ lon
 	return r;
 }
 
+static inline unsigned long __attribute_const__ roundup_pow_of_two(unsigned long x)
+{
+	return (1UL << fls(x - 1));
+}
 
 extern int printk_ratelimit(void);
 extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
_
