Skip to content

Commit

Permalink
x86: constify stacktrace_ops
Browse files Browse the repository at this point in the history
.. as they're never written to.

[ tglx: arch/x86 adaptation ]

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Jan Beulich authored and Thomas Gleixner committed Oct 17, 2007
1 parent ff7f364 commit 9689ba8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion arch/x86/kernel/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static void save_stack_address(void *data, unsigned long addr)
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,
Expand Down
6 changes: 3 additions & 3 deletions arch/x86/kernel/traps_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,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;
Expand Down Expand Up @@ -149,7 +149,7 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo,

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;

Expand Down Expand Up @@ -221,7 +221,7 @@ static void print_trace_address(void *data, unsigned long addr)
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,
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/kernel/traps_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)

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;
Expand Down Expand Up @@ -336,7 +336,7 @@ static void print_trace_address(void *data, unsigned long addr)
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,
Expand Down
2 changes: 1 addition & 1 deletion include/asm-x86/stacktrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9689ba8

Please sign in to comment.