Skip to content

Commit ed2b9e1

Browse files
committed
srcu,notifier: Remove #ifdefs in favor of SRCU Tiny srcu_usage
This commit removes two #ifdef directives from include/linux/notifier.h by causing SRCU Tiny to provide a dummy srcu_usage structure and a dummy __SRCU_USAGE_INIT() macro. Suggested-by: Linus Torvalds <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: "Michał Mirosław" <[email protected]> Cc: Dmitry Osipenko <[email protected]> Cc: Sachin Sant <[email protected]> Cc: Joel Fernandes (Google) <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent c924bf5 commit ed2b9e1

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

include/linux/notifier.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ struct raw_notifier_head {
7373

7474
struct srcu_notifier_head {
7575
struct mutex mutex;
76-
#ifdef CONFIG_TREE_SRCU
7776
struct srcu_usage srcuu;
78-
#endif
7977
struct srcu_struct srcu;
8078
struct notifier_block __rcu *head;
8179
};
@@ -106,22 +104,13 @@ extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
106104
#define RAW_NOTIFIER_INIT(name) { \
107105
.head = NULL }
108106

109-
#ifdef CONFIG_TREE_SRCU
110107
#define SRCU_NOTIFIER_INIT(name, pcpu) \
111108
{ \
112109
.mutex = __MUTEX_INITIALIZER(name.mutex), \
113110
.head = NULL, \
114111
.srcuu = __SRCU_USAGE_INIT(name.srcuu), \
115112
.srcu = __SRCU_STRUCT_INIT(name.srcu, name.srcuu, pcpu), \
116113
}
117-
#else
118-
#define SRCU_NOTIFIER_INIT(name, pcpu) \
119-
{ \
120-
.mutex = __MUTEX_INITIALIZER(name.mutex), \
121-
.head = NULL, \
122-
.srcu = __SRCU_STRUCT_INIT(name.srcu, name.srcuu, pcpu), \
123-
}
124-
#endif
125114

126115
#define ATOMIC_NOTIFIER_HEAD(name) \
127116
struct atomic_notifier_head name = \

include/linux/srcutiny.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ void srcu_drive_gp(struct work_struct *wp);
4848
#define DEFINE_STATIC_SRCU(name) \
4949
static struct srcu_struct name = __SRCU_STRUCT_INIT(name, name, name)
5050

51+
// Dummy structure for srcu_notifier_head.
52+
struct srcu_usage { };
53+
#define __SRCU_USAGE_INIT(name) { }
54+
5155
void synchronize_srcu(struct srcu_struct *ssp);
5256

5357
/*

0 commit comments

Comments
 (0)