[PATCH] jump_label: mark __start/stop___jump_table const

From: Michael S. Tsirkin
Date: Thu Feb 09 2017 - 16:19:41 EST


Attempts to assign values through these pointers would fail.
Mark them const to make sure the failure is compile time.

Cc: Jason Baron <jbaron@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Mel Gorman <mgorman@xxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
---
include/linux/jump_label.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index a0547c5..48ed83f 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -132,8 +132,8 @@ static __always_inline bool static_key_true(struct static_key *key)
return !arch_static_branch(key, true);
}

-extern struct jump_entry __start___jump_table[];
-extern struct jump_entry __stop___jump_table[];
+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);
--
MST