summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2013-03-19 13:41:04 (GMT)
committerScott Wood <scottwood@freescale.com>2013-04-04 22:09:05 (GMT)
commit65727343ee193ac4955d409ad58fe4a1be252d95 (patch)
treee8b8e2c0056331f33c9e6ba382d5cd32274c4251 /include
parent90f73aa79422e1d1e69d2713a6153980f89e03c4 (diff)
downloadlinux-fsl-qoriq-65727343ee193ac4955d409ad58fe4a1be252d95.tar.xz
kernel/srcu: merge common code into a macro
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/srcu.h10
1 files 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