Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1577959 > unrolled thread

[PATCH] jump_label: mark __start/stop___jump_table const

Started by"Michael S. Tsirkin" <mst@redhat.com>
First post2017-02-09 22:20 +0100
Last post2017-02-09 23:00 +0100
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] jump_label: mark __start/stop___jump_table const "Michael S. Tsirkin" <mst@redhat.com> - 2017-02-09 22:20 +0100
    Re: [PATCH] jump_label: mark __start/stop___jump_table const "Michael S. Tsirkin" <mst@redhat.com> - 2017-02-09 23:00 +0100

#1577959 — [PATCH] jump_label: mark __start/stop___jump_table const

From"Michael S. Tsirkin" <mst@redhat.com>
Date2017-02-09 22:20 +0100
Subject[PATCH] jump_label: mark __start/stop___jump_table const
Message-ID<t94ie-2Qq-7@gated-at.bofh.it>
Attempts to assign values through these pointers would fail.
Mark them const to make sure the failure is compile time.

Cc: Jason Baron <jbaron@akamai.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 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

[toc] | [next] | [standalone]


#1577981

From"Michael S. Tsirkin" <mst@redhat.com>
Date2017-02-09 23:00 +0100
Message-ID<t94UV-33U-1@gated-at.bofh.it>
In reply to#1577959
On Thu, Feb 09, 2017 at 11:11:32PM +0200, Michael S. Tsirkin wrote:
> Attempts to assign values through these pointers would fail.
> Mark them const to make sure the failure is compile time.
> 
> Cc: Jason Baron <jbaron@akamai.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Hmm this produces a bunch of warnings that I managed
to somehow miss. Self-Nack. Pls disregard.

> ---
>  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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web