All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: "Andi Kleen" <ak@suse.de>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86: constify stacktrace_ops
Date: Mon, 10 Sep 2007 14:02:17 +0100	[thread overview]
Message-ID: <46E55C79.76E4.0078.0@novell.com> (raw)

.. as they're never written to.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

 arch/i386/kernel/traps.c        |    6 +++---
 arch/x86_64/kernel/stacktrace.c |    2 +-
 arch/x86_64/kernel/traps.c      |    4 ++--
 include/asm-x86_64/stacktrace.h |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

--- linux-2.6.23-rc5/arch/i386/kernel/traps.c	2007-09-07 16:44:45.000000000 +0200
+++ 2.6.23-rc5-x86-const-stacktrace_ops/arch/i386/kernel/traps.c	2007-08-28 17:39:12.000000000 +0200
@@ -114,7 +114,7 @@ struct stack_frame {
 
 static inline unsigned long print_context_stack(struct thread_info *tinfo,
 				unsigned long *stack, unsigned long ebp,
-				struct stacktrace_ops *ops, void *data)
+				const struct stacktrace_ops *ops, void *data)
 {
 #ifdef	CONFIG_FRAME_POINTER
 	struct stack_frame *frame = (struct stack_frame *)ebp;
@@ -151,7 +151,7 @@ static inline unsigned long print_contex
 
 void dump_trace(struct task_struct *task, struct pt_regs *regs,
 	        unsigned long *stack,
-		struct stacktrace_ops *ops, void *data)
+		const struct stacktrace_ops *ops, void *data)
 {
 	unsigned long ebp = 0;
 
@@ -223,7 +223,7 @@ static void print_trace_address(void *da
 	touch_nmi_watchdog();
 }
 
-static struct stacktrace_ops print_trace_ops = {
+static const struct stacktrace_ops print_trace_ops = {
 	.warning = print_trace_warning,
 	.warning_symbol = print_trace_warning_symbol,
 	.stack = print_trace_stack,
--- linux-2.6.23-rc5/arch/x86_64/kernel/stacktrace.c	2007-07-09 01:32:17.000000000 +0200
+++ 2.6.23-rc5-x86-const-stacktrace_ops/arch/x86_64/kernel/stacktrace.c	2007-08-28 17:38:06.000000000 +0200
@@ -35,7 +35,7 @@ static void save_stack_address(void *dat
 		trace->entries[trace->nr_entries++] = addr;
 }
 
-static struct stacktrace_ops save_stack_ops = {
+static const struct stacktrace_ops save_stack_ops = {
 	.warning = save_stack_warning,
 	.warning_symbol = save_stack_warning_symbol,
 	.stack = save_stack_stack,
--- linux-2.6.23-rc5/arch/x86_64/kernel/traps.c	2007-09-07 16:45:27.000000000 +0200
+++ 2.6.23-rc5-x86-const-stacktrace_ops/arch/x86_64/kernel/traps.c	2007-08-28 17:38:39.000000000 +0200
@@ -217,7 +217,7 @@ static inline int valid_stack_ptr(struct
 
 void dump_trace(struct task_struct *tsk, struct pt_regs *regs,
 		unsigned long *stack,
-		struct stacktrace_ops *ops, void *data)
+		const struct stacktrace_ops *ops, void *data)
 {
 	const unsigned cpu = get_cpu();
 	unsigned long *irqstack_end = (unsigned long*)cpu_pda(cpu)->irqstackptr;
@@ -338,7 +338,7 @@ static void print_trace_address(void *da
 	printk_address(addr);
 }
 
-static struct stacktrace_ops print_trace_ops = {
+static const struct stacktrace_ops print_trace_ops = {
 	.warning = print_trace_warning,
 	.warning_symbol = print_trace_warning_symbol,
 	.stack = print_trace_stack,
--- linux-2.6.23-rc5/include/asm-x86_64/stacktrace.h	2007-02-04 19:44:54.000000000 +0100
+++ 2.6.23-rc5-x86-const-stacktrace_ops/include/asm-x86_64/stacktrace.h	2007-08-28 17:37:55.000000000 +0200
@@ -15,6 +15,6 @@ struct stacktrace_ops {
 };
 
 void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long *stack,
-		struct stacktrace_ops *ops, void *data);
+		const struct stacktrace_ops *ops, void *data);
 
 #endif




             reply	other threads:[~2007-09-10 13:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-10 13:02 Jan Beulich [this message]
2007-09-16 10:18 ` [PATCH] x86: constify stacktrace_ops Andrew Morton
2007-09-17  8:58   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46E55C79.76E4.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.