diff options
Diffstat (limited to 'include/linux/jump_label.h')
-rw-r--r-- | include/linux/jump_label.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index 8e06d758ee48..2afd74b9d844 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h | |||
@@ -90,6 +90,13 @@ extern bool static_key_initialized; | |||
90 | struct static_key { | 90 | struct static_key { |
91 | atomic_t enabled; | 91 | atomic_t enabled; |
92 | /* | 92 | /* |
93 | * Note: | ||
94 | * To make anonymous unions work with old compilers, the static | ||
95 | * initialization of them requires brackets. This creates a dependency | ||
96 | * on the order of the struct with the initializers. If any fields | ||
97 | * are added, STATIC_KEY_INIT_TRUE and STATIC_KEY_INIT_FALSE may need | ||
98 | * to be modified. | ||
99 | * | ||
93 | * bit 0 => 1 if key is initially true | 100 | * bit 0 => 1 if key is initially true |
94 | * 0 if initially false | 101 | * 0 if initially false |
95 | * bit 1 => 1 if points to struct static_key_mod | 102 | * bit 1 => 1 if points to struct static_key_mod |
@@ -166,10 +173,10 @@ extern void static_key_disable(struct static_key *key); | |||
166 | */ | 173 | */ |
167 | #define STATIC_KEY_INIT_TRUE \ | 174 | #define STATIC_KEY_INIT_TRUE \ |
168 | { .enabled = { 1 }, \ | 175 | { .enabled = { 1 }, \ |
169 | .entries = (void *)JUMP_TYPE_TRUE } | 176 | { .entries = (void *)JUMP_TYPE_TRUE } } |
170 | #define STATIC_KEY_INIT_FALSE \ | 177 | #define STATIC_KEY_INIT_FALSE \ |
171 | { .enabled = { 0 }, \ | 178 | { .enabled = { 0 }, \ |
172 | .entries = (void *)JUMP_TYPE_FALSE } | 179 | { .entries = (void *)JUMP_TYPE_FALSE } } |
173 | 180 | ||
174 | #else /* !HAVE_JUMP_LABEL */ | 181 | #else /* !HAVE_JUMP_LABEL */ |
175 | 182 | ||