Re: [RFC, 2.6] a simple FIFO implementation

From: Ryan Cumming
Date: Fri Sep 17 2004 - 17:43:39 EST


Er, sorry, the last patch was had an off-by-one error (it would round 4 up to
8).

-Ryan
--- include/linux/kernel.h 2004-09-16 06:38:19.000000000 -0700
+++ include/linux/kernel.h 2004-09-17 15:12:20.598844004 -0700
@@ -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 @@
return r;
}

+static inline unsigned long __attribute_pure__ roundup_pow_of_two(int x)
+{
+ return (1UL << fls(x - 1));
+}

extern int printk_ratelimit(void);
extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);

Attachment: pgp00000.pgp
Description: PGP signature