Re: [PATCH v3 1/8] riscv: add prototypes for assembly language functions from entry.S

From: Christoph Hellwig
Date: Fri Oct 18 2019 - 11:49:26 EST


On Fri, Oct 18, 2019 at 01:08:34AM -0700, Paul Walmsley wrote:
> Add prototypes for assembly language functions defined in entry.S,
> and include these prototypes into C source files that call those
> functions.
>
> This patch resolves the following warnings from sparse:
>
> arch/riscv/kernel/signal.c:32:53: warning: incorrect type in initializer (different address spaces)

I don't see how adding prototypes will fix an address space warning.

> +asmlinkage void do_trap_unknown(struct pt_regs *regs);
> +asmlinkage void do_trap_insn_misaligned(struct pt_regs *regs);
> +asmlinkage void do_trap_insn_fault(struct pt_regs *regs);
> +asmlinkage void do_trap_insn_illegal(struct pt_regs *regs);
> +asmlinkage void do_trap_load_misaligned(struct pt_regs *regs);
> +asmlinkage void do_trap_load_fault(struct pt_regs *regs);
> +asmlinkage void do_trap_store_misaligned(struct pt_regs *regs);
> +asmlinkage void do_trap_store_fault(struct pt_regs *regs);
> +asmlinkage void do_trap_ecall_u(struct pt_regs *regs);
> +asmlinkage void do_trap_ecall_s(struct pt_regs *regs);
> +asmlinkage void do_trap_ecall_m(struct pt_regs *regs);
> +asmlinkage void do_trap_break(struct pt_regs *regs);

All these are not defined in entry.S, but called from entry.S.

And as Luc pointed out last time the easiest way to fix the sparse
warnings is to add __visible to the definitions of those functions.