LKML Archive on
help / color / mirror / Atom feed
* [PATCH] C99 initializers for DEFINE_RATELIMIT_STATE()
@ 2008-10-28 19:04 Bart Van Assche
  0 siblings, 0 replies; only message in thread
From: Bart Van Assche @ 2008-10-28 19:04 UTC (permalink / raw)
  To: Dave Young; +Cc: Linus Torvalds, Andrew Morton, linux-kernel

A few months ago (July 25, 2008) the printk ratelimiting code has been
rewritten. This patch added a.o. the new macro DEFINE_RATELIMIT_STATE(). The
patch below converts the initializers in that macro to C99 style.

For more information about the printk ratelimiting rewrite, see also commit

Signed-off-by: Bart Van Assche <>

diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index 18a5b9b..61cc908 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -13,8 +13,9 @@ struct ratelimit_state {
 	unsigned long begin;
-#define DEFINE_RATELIMIT_STATE(name, interval, burst)		\
-		struct ratelimit_state name = {interval, burst,}
+#define DEFINE_RATELIMIT_STATE(name, interval_value, burst_value)	\
+	struct ratelimit_state name =					\
+		{ .interval = (interval_value), .burst = (burst_value) }
 extern int __ratelimit(struct ratelimit_state *rs);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-28 19:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-28 19:04 [PATCH] C99 initializers for DEFINE_RATELIMIT_STATE() Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).