Skip to content

Commit e2b6e5e

Browse files
committed
jump_label: Define guard() for jump_label_lock
Link: https://lore.kernel.org/all/173371207108.480397.12818384744149153972.stgit@devnote2/ Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
1 parent 4e83017 commit e2b6e5e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/linux/jump_label.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575

7676
#include <linux/types.h>
7777
#include <linux/compiler.h>
78+
#include <linux/cleanup.h>
7879

7980
extern bool static_key_initialized;
8081

@@ -347,6 +348,8 @@ static inline void static_key_disable(struct static_key *key)
347348

348349
#endif /* CONFIG_JUMP_LABEL */
349350

351+
DEFINE_LOCK_GUARD_0(jump_label_lock, jump_label_lock(), jump_label_unlock())
352+
350353
#define STATIC_KEY_INIT STATIC_KEY_INIT_FALSE
351354
#define jump_label_enabled static_key_enabled
352355

0 commit comments

Comments
 (0)