jump_label: use defined macros instead of hard-coding for better readability

Use macro JUMP_LABEL_TRUE_BRANCH instead of hard-coding for better
readability.

Acked-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Jason Baron <jbaron@akamai.com>
Signed-off-by: Jiang Liu <liuj97@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by Jiang Liu and committed by Catalin Marinas f4be8433 9732cafd

+12 -7
+12 -7
include/linux/jump_label.h
··· 81 81 #include <linux/atomic.h> 82 82 #ifdef HAVE_JUMP_LABEL 83 83 84 - #define JUMP_LABEL_TRUE_BRANCH 1UL 84 + #define JUMP_LABEL_TYPE_FALSE_BRANCH 0UL 85 + #define JUMP_LABEL_TYPE_TRUE_BRANCH 1UL 86 + #define JUMP_LABEL_TYPE_MASK 1UL 85 87 86 88 static 87 89 inline struct jump_entry *jump_label_get_entries(struct static_key *key) 88 90 { 89 91 return (struct jump_entry *)((unsigned long)key->entries 90 - & ~JUMP_LABEL_TRUE_BRANCH); 92 + & ~JUMP_LABEL_TYPE_MASK); 91 93 } 92 94 93 95 static inline bool jump_label_get_branch_default(struct static_key *key) 94 96 { 95 - if ((unsigned long)key->entries & JUMP_LABEL_TRUE_BRANCH) 97 + if (((unsigned long)key->entries & JUMP_LABEL_TYPE_MASK) == 98 + JUMP_LABEL_TYPE_TRUE_BRANCH) 96 99 return true; 97 100 return false; 98 101 } ··· 125 122 extern void static_key_slow_dec(struct static_key *key); 126 123 extern void jump_label_apply_nops(struct module *mod); 127 124 128 - #define STATIC_KEY_INIT_TRUE ((struct static_key) \ 129 - { .enabled = ATOMIC_INIT(1), .entries = (void *)1 }) 130 - #define STATIC_KEY_INIT_FALSE ((struct static_key) \ 131 - { .enabled = ATOMIC_INIT(0), .entries = (void *)0 }) 125 + #define STATIC_KEY_INIT_TRUE ((struct static_key) \ 126 + { .enabled = ATOMIC_INIT(1), \ 127 + .entries = (void *)JUMP_LABEL_TYPE_TRUE_BRANCH }) 128 + #define STATIC_KEY_INIT_FALSE ((struct static_key) \ 129 + { .enabled = ATOMIC_INIT(0), \ 130 + .entries = (void *)JUMP_LABEL_TYPE_FALSE_BRANCH }) 132 131 133 132 #else /* !HAVE_JUMP_LABEL */ 134 133