Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[MIPS] IP22: Fix warning.

CC arch/mips/sgi-ip22/ip22-berr.o
arch/mips/sgi-ip22/ip22-berr.c: In function 'ip22_be_interrupt':
arch/mips/sgi-ip22/ip22-berr.c:100: warning: passing argument 2 of 'die_if_kernel' discards qualifiers from pointer target type

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

+17 -8
+15 -6
arch/mips/kernel/traps.c
··· 104 104 __setup("raw_show_trace", set_raw_show_trace); 105 105 #endif 106 106 107 - static void show_backtrace(struct task_struct *task, struct pt_regs *regs) 107 + static void show_backtrace(struct task_struct *task, const struct pt_regs *regs) 108 108 { 109 109 unsigned long sp = regs->regs[29]; 110 110 unsigned long ra = regs->regs[31]; ··· 126 126 * This routine abuses get_user()/put_user() to reference pointers 127 127 * with at least a bit of error checking ... 128 128 */ 129 - static void show_stacktrace(struct task_struct *task, struct pt_regs *regs) 129 + static void show_stacktrace(struct task_struct *task, 130 + const struct pt_regs *regs) 130 131 { 131 132 const int field = 2 * sizeof(unsigned long); 132 133 long stackdata; ··· 204 203 } 205 204 } 206 205 207 - void show_regs(struct pt_regs *regs) 206 + static void __show_regs(const struct pt_regs *regs) 208 207 { 209 208 const int field = 2 * sizeof(unsigned long); 210 209 unsigned int cause = regs->cp0_cause; ··· 300 299 cpu_name_string()); 301 300 } 302 301 303 - void show_registers(struct pt_regs *regs) 302 + /* 303 + * FIXME: really the generic show_regs should take a const pointer argument. 304 + */ 305 + void show_regs(struct pt_regs *regs) 304 306 { 305 - show_regs(regs); 307 + __show_regs((struct pt_regs *)regs); 308 + } 309 + 310 + void show_registers(const struct pt_regs *regs) 311 + { 312 + __show_regs(regs); 306 313 print_modules(); 307 314 printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n", 308 315 current->comm, current->pid, current_thread_info(), current); ··· 321 312 322 313 static DEFINE_SPINLOCK(die_lock); 323 314 324 - void __noreturn die(const char * str, struct pt_regs * regs) 315 + void __noreturn die(const char * str, const struct pt_regs * regs) 325 316 { 326 317 static int die_counter; 327 318 #ifdef CONFIG_MIPS_MT_SMTC
+2 -2
include/asm-mips/ptrace.h
··· 86 86 87 87 extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); 88 88 89 - extern NORET_TYPE void die(const char *, struct pt_regs *) ATTRIB_NORET; 89 + extern NORET_TYPE void die(const char *, const struct pt_regs *) ATTRIB_NORET; 90 90 91 - static inline void die_if_kernel(const char *str, struct pt_regs *regs) 91 + static inline void die_if_kernel(const char *str, const struct pt_regs *regs) 92 92 { 93 93 if (unlikely(!user_mode(regs))) 94 94 die(str, regs);