All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] kernel/srcu: merge common code into a macro
@ 2013-03-19 14:16 Sebastian Andrzej Siewior
  2013-03-19 14:16 ` [PATCH 2/3] kernel/SRCU: provide a static initializer Sebastian Andrzej Siewior
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-03-19 14:16 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: Lai Jiangshan, linux-kernel, tglx, Sebastian Andrzej Siewior

DEFINE_SRCU() and DEFINE_STATIC_SRCU() does the same thing except for
the "static" attribute. This patch moves the common pieces into
_DEFINE_SRCU() which is used by the the former macros either adding the
static attribute or not.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 include/linux/srcu.h |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 6eb691b..d04acb8 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -102,13 +102,13 @@ void process_srcu(struct work_struct *work);
  * define and init a srcu struct at build time.
  * dont't call init_srcu_struct() nor cleanup_srcu_struct() on it.
  */
-#define DEFINE_SRCU(name)						\
+#define _DEFINE_SRCU(name, mod)						\
 	static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\
-	struct srcu_struct name = __SRCU_STRUCT_INIT(name);
+	mod struct srcu_struct name =					\
+				__SRCU_STRUCT_INIT(name);
 
-#define DEFINE_STATIC_SRCU(name)					\
-	static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\
-	static struct srcu_struct name = __SRCU_STRUCT_INIT(name);
+#define DEFINE_SRCU(name)		_DEFINE_SRCU(name, )
+#define DEFINE_STATIC_SRCU(name)	_DEFINE_SRCU(name, static)
 
 /**
  * call_srcu() - Queue a callback for invocation after an SRCU grace period
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-04-16 18:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-19 14:16 [PATCH 1/3] kernel/srcu: merge common code into a macro Sebastian Andrzej Siewior
2013-03-19 14:16 ` [PATCH 2/3] kernel/SRCU: provide a static initializer Sebastian Andrzej Siewior
2013-04-05  7:21   ` Lai Jiangshan
2013-04-08 10:03     ` Sebastian Andrzej Siewior
2013-04-09  1:09       ` Lai Jiangshan
2013-04-11 17:04         ` Sebastian Andrzej Siewior
2013-04-12  2:56           ` Lai Jiangshan
2013-04-16 18:20             ` Paul E. McKenney
2013-03-19 14:16 ` [PATCH 3/3] cpufreq: use static initializer for the SRCU notifier Sebastian Andrzej Siewior
2013-03-19 16:22 ` [PATCH 1/3] kernel/srcu: merge common code into a macro Joe Perches
2013-03-19 18:15   ` Sebastian Andrzej Siewior
2013-04-05  7:21 ` Lai Jiangshan
2013-04-08 10:05   ` Sebastian Andrzej Siewior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.