Skip to contentSkip to conversation

jump_label: don't export section tags

PATCH In review Michael S. Tsirkin 3 participants 3 messages Feb 10, 2017 Static branch/call

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 jump_label: don't export section tags

These are supplied by the linker and only used by jump_label.c. This trivial patch moves them out of jump_label.h.

Cc Jason Baron <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Ingo Molnar <[email protected]>
---
 include/linux/jump_label.h | 3 ---
 kernel/jump_label.c        | 4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)
include/linux/jump_label.h +0 -3
index 48ed83f..21701da 100644
@@ -132,9 +132,6 @@ static __always_inline bool static_key_true(struct static_key *key)
 	return !arch_static_branch(key, true);
 }
 
-extern const struct jump_entry __start___jump_table[];
-extern const struct jump_entry __stop___jump_table[];
-
 extern void jump_label_init(void);
 extern void jump_label_lock(void);
 extern void jump_label_unlock(void);
kernel/jump_label.c +4 -0
index a9b8cf5..6eaa84c 100644
@@ -18,6 +18,10 @@
 
 #ifdef HAVE_JUMP_LABEL
 
+/* Supplied by a linker script */
+extern struct jump_entry __start___jump_table[];
+extern struct jump_entry __stop___jump_table[];
+
 /* mutex to protect coming/going of the the jump_label table */
 static DEFINE_MUTEX(jump_label_mutex);
 
Signature · 1 line
MST
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 37 lines · On Fri, 10 Feb 2017 19:29:44 +0200 "Michael S. Tsirkin" <[email protected]> wrote:

These are supplied by the linker and only used by jump_label.c. This trivial patch moves them out of jump_label.h.

Cc Jason Baron <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Ingo Molnar <[email protected]>
---
 include/linux/jump_label.h | 3 ---
 kernel/jump_label.c        | 4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)
include/linux/jump_label.h +0 -3
index 48ed83f..21701da 100644
@@ -132,9 +132,6 @@ static __always_inline bool static_key_true(struct static_key *key)
 	return !arch_static_branch(key, true);
 }
 
-extern const struct jump_entry __start___jump_table[];
-extern const struct jump_entry __stop___jump_table[];
-
 extern void jump_label_init(void);
 extern void jump_label_lock(void);
 extern void jump_label_unlock(void);
kernel/jump_label.c +0 -0
index a9b8cf5..6eaa84c 100644

kernel/jump_label.c line 21

Quoted 4 lines
kernel/jump_label.c +1 -0
@@ -18,6 +18,10 @@
 
 #ifdef HAVE_JUMP_LABEL
 
+/* Supplied by a linker script */

This is common practice and obvious to anyone that does a git grep. I don't really think the comment is necessary.

But the change itself is fine.

-- Steve

Quoted 6 lines
kernel/jump_label.c +3 -0
+extern struct jump_entry __start___jump_table[];
+extern struct jump_entry __stop___jump_table[];
+
 /* mutex to protect coming/going of the the jump_label table */
 static DEFINE_MUTEX(jump_label_mutex);
 
maintainer
#2 lore raw
In reply to Michael S. Tsirkin
Quoted 23 lines · Michael S. Tsirkin

These are supplied by the linker and only used by jump_label.c. This trivial patch moves them out of jump_label.h.

Cc Jason Baron <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Ingo Molnar <[email protected]>
---
 include/linux/jump_label.h | 3 ---
 kernel/jump_label.c        | 4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)
include/linux/jump_label.h +0 -0
index 48ed83f..21701da 100644

include/linux/jump_label.h static __always_inline bool static_key_true(struct static_key *key) · line 137

Quoted 9 lines
include/linux/jump_label.h +0 -3
@@ -132,9 +132,6 @@ static __always_inline bool static_key_true(struct static_key *key)
 	return !arch_static_branch(key, true);
 }
 
-extern const struct jump_entry __start___jump_table[];
-extern const struct jump_entry __stop___jump_table[];
-
 extern void jump_label_init(void);
 extern void jump_label_lock(void);
 extern void jump_label_unlock(void);

hmmm - looks this was on top of your previous patch? Otherwise, looks good to me.

Thanks,

-Jason

Quoted 16 lines
kernel/jump_label.c +4 -0
index a9b8cf5..6eaa84c 100644
@@ -18,6 +18,10 @@
 
 #ifdef HAVE_JUMP_LABEL
 
+/* Supplied by a linker script */
+extern struct jump_entry __start___jump_table[];
+extern struct jump_entry __stop___jump_table[];
+
 /* mutex to protect coming/going of the the jump_label table */
 static DEFINE_MUTEX(jump_label_mutex);