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

sparc: fix sparse warnings in traps_32.c

o add decalrations to entry.h for functions only used from assembler
o add declaratiosn to kernel.h for functions only used from .c
o removed unused functions/extern declarations

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Sam Ravnborg and committed by
David S. Miller
8d74e32a 85bfbf44

+49 -34
+35
arch/sparc/kernel/entry.h
··· 5 5 #include <linux/types.h> 6 6 #include <linux/init.h> 7 7 8 + #ifdef CONFIG_SPARC32 9 + /* traps */ 10 + extern void do_hw_interrupt(struct pt_regs *regs, unsigned long type); 11 + extern void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, 12 + unsigned long npc, unsigned long psr); 13 + 14 + extern void do_priv_instruction(struct pt_regs *regs, unsigned long pc, 15 + unsigned long npc, unsigned long psr); 16 + extern void do_memaccess_unaligned(struct pt_regs *regs, unsigned long pc, 17 + unsigned long npc, 18 + unsigned long psr); 19 + extern void do_fpd_trap(struct pt_regs *regs, unsigned long pc, 20 + unsigned long npc, unsigned long psr); 21 + extern void do_fpe_trap(struct pt_regs *regs, unsigned long pc, 22 + unsigned long npc, unsigned long psr); 23 + extern void handle_tag_overflow(struct pt_regs *regs, unsigned long pc, 24 + unsigned long npc, unsigned long psr); 25 + extern void handle_watchpoint(struct pt_regs *regs, unsigned long pc, 26 + unsigned long npc, unsigned long psr); 27 + extern void handle_reg_access(struct pt_regs *regs, unsigned long pc, 28 + unsigned long npc, unsigned long psr); 29 + extern void handle_cp_disabled(struct pt_regs *regs, unsigned long pc, 30 + unsigned long npc, unsigned long psr); 31 + extern void handle_cp_exception(struct pt_regs *regs, unsigned long pc, 32 + unsigned long npc, unsigned long psr); 33 + 34 + 35 + 36 + /* entry.S */ 37 + extern void fpsave(unsigned long *fpregs, unsigned long *fsr, 38 + void *fpqueue, unsigned long *fpqdepth); 39 + extern void fpload(unsigned long *fpregs, unsigned long *fsr); 40 + 41 + #else /* CONFIG_SPARC32 */ 8 42 extern void __init per_cpu_patch(void); 9 43 extern void __init sun4v_patch(void); 10 44 extern void __init boot_cpu_id_too_large(int cpu); ··· 223 189 extern void init_irqwork_curcpu(void); 224 190 extern void __cpuinit sun4v_register_mondo_queues(int this_cpu); 225 191 192 + #endif /* CONFIG_SPARC32 */ 226 193 #endif /* _ENTRY_H */
+9
arch/sparc/kernel/kernel.h
··· 4 4 5 5 extern unsigned int fsr_storage; 6 6 7 + #ifdef CONFIG_SPARC32 8 + /* cpu.c */ 7 9 extern void cpu_probe(void); 8 10 11 + /* traps_32.c */ 12 + extern void handle_hw_divzero(struct pt_regs *regs, unsigned long pc, 13 + unsigned long npc, unsigned long psr); 14 + /* muldiv.c */ 15 + extern int do_user_muldiv (struct pt_regs *, unsigned long); 16 + #else /* CONFIG_SPARC32 */ 17 + #endif
+2 -3
arch/sparc/kernel/muldiv.c
··· 17 17 #include <asm/system.h> 18 18 #include <asm/uaccess.h> 19 19 20 + #include "kernel.h" 21 + 20 22 /* #define DEBUG_MULDIV */ 21 23 22 24 static inline int has_imm13(int insn) ··· 90 88 return (put_user(result, &win->locals[reg - 16])); 91 89 } 92 90 } 93 - 94 - extern void handle_hw_divzero (struct pt_regs *regs, unsigned long pc, 95 - unsigned long npc, unsigned long psr); 96 91 97 92 /* Should return 0 if mul/div emulation succeeded and SIGILL should 98 93 * not be issued.
+3 -31
arch/sparc/kernel/traps_32.c
··· 25 25 #include <asm/unistd.h> 26 26 #include <asm/traps.h> 27 27 28 + #include "entry.h" 29 + #include "kernel.h" 30 + 28 31 /* #define TRAP_DEBUG */ 29 - 30 - struct trap_trace_entry { 31 - unsigned long pc; 32 - unsigned long type; 33 - }; 34 - 35 - void syscall_trace_entry(struct pt_regs *regs) 36 - { 37 - printk("%s[%d]: ", current->comm, task_pid_nr(current)); 38 - printk("scall<%d> (could be %d)\n", (int) regs->u_regs[UREG_G1], 39 - (int) regs->u_regs[UREG_I0]); 40 - } 41 - 42 - void syscall_trace_exit(struct pt_regs *regs) 43 - { 44 - } 45 - 46 - void sun4d_nmi(struct pt_regs *regs) 47 - { 48 - printk("Aieee: sun4d NMI received!\n"); 49 - printk("you lose buddy boy...\n"); 50 - show_regs(regs); 51 - prom_halt(); 52 - } 53 32 54 33 static void instruction_dump(unsigned long *pc) 55 34 { ··· 113 134 void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, unsigned long npc, 114 135 unsigned long psr) 115 136 { 116 - extern int do_user_muldiv (struct pt_regs *, unsigned long); 117 137 siginfo_t info; 118 138 119 139 if(psr & PSR_PS) ··· 172 194 info.si_trapno = 0; 173 195 send_sig_info(SIGBUS, &info, current); 174 196 } 175 - 176 - extern void fpsave(unsigned long *fpregs, unsigned long *fsr, 177 - void *fpqueue, unsigned long *fpqdepth); 178 - extern void fpload(unsigned long *fpregs, unsigned long *fsr); 179 197 180 198 static unsigned long init_fsr = 0x0UL; 181 199 static unsigned long init_fregs[32] __attribute__ ((aligned (8))) = ··· 429 455 /* Since we have our mappings set up, on multiprocessors we can spin them 430 456 * up here so that timer interrupts work during initialization. 431 457 */ 432 - 433 - extern void sparc_cpu_startup(void); 434 458 435 459 void trap_init(void) 436 460 {