summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>2026-03-13 11:22:18 +0300
committerPeter Zijlstra <peterz@infradead.org>2026-03-16 15:16:48 +0300
commit428c56525bf5dbc3bd5e30014df1f5213f8bd7c8 (patch)
tree0b647315d2502a2a620eadb64b036e861e75babc /include
parent16df04446e34a1e7dba57f657af6ad5f51199763 (diff)
downloadlinux-428c56525bf5dbc3bd5e30014df1f5213f8bd7c8.tar.xz
jump_label: use ATOMIC_INIT() for initialization of .enabled
Currently ATOMIC_INIT() is not used because in the past that macro was provided by linux/atomic.h which is not usable from linux/jump_label.h. However since commit 7ca8cf5347f7 ("locking/atomic: Move ATOMIC_INIT into linux/types.h") the macro only requires linux/types.h. Remove the now unnecessary workaround and the associated assertions. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://patch.msgid.link/20260313-jump_label-cleanup-v2-1-35d3c0bde549@linutronix.de
Diffstat (limited to 'include')
-rw-r--r--include/linux/jump_label.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index fdb79dd1ebd8..e494b360d36d 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -238,18 +238,11 @@ extern void static_key_enable_cpuslocked(struct static_key *key);
extern void static_key_disable_cpuslocked(struct static_key *key);
extern enum jump_label_type jump_label_init_type(struct jump_entry *entry);
-/*
- * We should be using ATOMIC_INIT() for initializing .enabled, but
- * the inclusion of atomic.h is problematic for inclusion of jump_label.h
- * in 'low-level' headers. Thus, we are initializing .enabled with a
- * raw value, but have added a BUILD_BUG_ON() to catch any issues in
- * jump_label_init() see: kernel/jump_label.c.
- */
#define STATIC_KEY_INIT_TRUE \
- { .enabled = { 1 }, \
+ { .enabled = ATOMIC_INIT(1), \
{ .type = JUMP_TYPE_TRUE } }
#define STATIC_KEY_INIT_FALSE \
- { .enabled = { 0 }, \
+ { .enabled = ATOMIC_INIT(0), \
{ .type = JUMP_TYPE_FALSE } }
#else /* !CONFIG_JUMP_LABEL */