diff mbox series

[v3,8/8] riscv: for C functions called only from assembly, mark with __visible

Message ID 20191018080841.26712-9-paul.walmsley@sifive.com (mailing list archive)
State New, archived
Headers show
Series riscv: resolve most warnings from sparse | expand

Commit Message

Paul Walmsley Oct. 18, 2019, 8:08 a.m. UTC
Rather than adding prototypes for C functions called only by assembly
code, mark them as __visible.  This avoids adding prototypes that will
never be used by the callers.  Resolves the following sparse warnings:

arch/riscv/kernel/ptrace.c:151:6: warning: symbol 'do_syscall_trace_enter' was not declared. Should it be static?
arch/riscv/kernel/ptrace.c:175:6: warning: symbol 'do_syscall_trace_exit' was not declared. Should it be static?

Based on a suggestion from Luc Van Oostenryck.

Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 arch/riscv/kernel/ptrace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Christoph Hellwig Oct. 18, 2019, 3:56 p.m. UTC | #1
On Fri, Oct 18, 2019 at 01:08:41AM -0700, Paul Walmsley wrote:
> Rather than adding prototypes for C functions called only by assembly
> code, mark them as __visible.  This avoids adding prototypes that will
> never be used by the callers.  Resolves the following sparse warnings:
> 
> arch/riscv/kernel/ptrace.c:151:6: warning: symbol 'do_syscall_trace_enter' was not declared. Should it be static?
> arch/riscv/kernel/ptrace.c:175:6: warning: symbol 'do_syscall_trace_exit' was not declared. Should it be static?
> 
> Based on a suggestion from Luc Van Oostenryck.
> 
> Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
> Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/arch/riscv/kernel/ptrace.c b/arch/riscv/kernel/ptrace.c
index 63e47c9f85f0..0f84628b9385 100644
--- a/arch/riscv/kernel/ptrace.c
+++ b/arch/riscv/kernel/ptrace.c
@@ -148,7 +148,7 @@  long arch_ptrace(struct task_struct *child, long request,
  * Allows PTRACE_SYSCALL to work.  These are called from entry.S in
  * {handle,ret_from}_syscall.
  */
-void do_syscall_trace_enter(struct pt_regs *regs)
+__visible void do_syscall_trace_enter(struct pt_regs *regs)
 {
 	if (test_thread_flag(TIF_SYSCALL_TRACE))
 		if (tracehook_report_syscall_entry(regs))
@@ -172,7 +172,7 @@  void do_syscall_trace_enter(struct pt_regs *regs)
 	audit_syscall_entry(regs->a7, regs->a0, regs->a1, regs->a2, regs->a3);
 }
 
-void do_syscall_trace_exit(struct pt_regs *regs)
+__visible void do_syscall_trace_exit(struct pt_regs *regs)
 {
 	audit_syscall_exit(regs);