Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rcu: Combine DEFINE_SRCU() and DEFINE_STATIC_SRCU()

The DEFINE_SRCU() and DEFINE_STATIC_SRCU() definitions are quite
similar, so this commit combines them, saving a bit of code and removing
redundancy.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

+4 -6
+4 -6
include/linux/srcu.h
··· 102 102 * define and init a srcu struct at build time. 103 103 * dont't call init_srcu_struct() nor cleanup_srcu_struct() on it. 104 104 */ 105 - #define DEFINE_SRCU(name) \ 105 + #define __DEFINE_SRCU(name, is_static) \ 106 106 static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\ 107 - struct srcu_struct name = __SRCU_STRUCT_INIT(name); 108 - 109 - #define DEFINE_STATIC_SRCU(name) \ 110 - static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\ 111 - static struct srcu_struct name = __SRCU_STRUCT_INIT(name); 107 + is_static struct srcu_struct name = __SRCU_STRUCT_INIT(name) 108 + #define DEFINE_SRCU(name) __DEFINE_SRCU(name, /* not static */) 109 + #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) 112 110 113 111 /** 114 112 * call_srcu() - Queue a callback for invocation after an SRCU grace period