Skip to content

Commit f307307

Browse files
riscv: for C functions called only from assembly, mark with __visible
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/irq.c:27:29: warning: symbol 'do_IRQ' was not declared. Should it be static? 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:165:6: warning: symbol 'do_syscall_trace_exit' was not declared. Should it be static? arch/riscv/kernel/signal.c:295:17: warning: symbol 'do_notify_resume' was not declared. Should it be static? arch/riscv/kernel/traps.c:92:1: warning: symbol 'do_trap_unknown' was not declared. Should it be static? arch/riscv/kernel/traps.c:94:1: warning: symbol 'do_trap_insn_misaligned' was not declared. Should it be static? arch/riscv/kernel/traps.c:96:1: warning: symbol 'do_trap_insn_fault' was not declared. Should it be static? arch/riscv/kernel/traps.c:98:1: warning: symbol 'do_trap_insn_illegal' was not declared. Should it be static? arch/riscv/kernel/traps.c:100:1: warning: symbol 'do_trap_load_misaligned' was not declared. Should it be static? arch/riscv/kernel/traps.c:102:1: warning: symbol 'do_trap_load_fault' was not declared. Should it be static? arch/riscv/kernel/traps.c:104:1: warning: symbol 'do_trap_store_misaligned' was not declared. Should it be static? arch/riscv/kernel/traps.c:106:1: warning: symbol 'do_trap_store_fault' was not declared. Should it be static? arch/riscv/kernel/traps.c:108:1: warning: symbol 'do_trap_ecall_u' was not declared. Should it be static? arch/riscv/kernel/traps.c:110:1: warning: symbol 'do_trap_ecall_s' was not declared. Should it be static? arch/riscv/kernel/traps.c:112:1: warning: symbol 'do_trap_ecall_m' was not declared. Should it be static? arch/riscv/kernel/traps.c:124:17: warning: symbol 'do_trap_break' was not declared. Should it be static? arch/riscv/kernel/smpboot.c:136:24: warning: symbol 'smp_callin' was not declared. Should it be static? Based on a suggestion from Luc Van Oostenryck. This version includes changes based on feedback from Christoph Hellwig <[email protected]>. Signed-off-by: Paul Walmsley <[email protected]> Cc: Luc Van Oostenryck <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> # for do_syscall_trace_*
1 parent a48dac4 commit f307307

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

arch/riscv/kernel/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ int arch_show_interrupts(struct seq_file *p, int prec)
2424
return 0;
2525
}
2626

27-
asmlinkage void __irq_entry do_IRQ(struct pt_regs *regs)
27+
asmlinkage __visible void __irq_entry do_IRQ(struct pt_regs *regs)
2828
{
2929
struct pt_regs *old_regs = set_irq_regs(regs);
3030

arch/riscv/kernel/ptrace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ long arch_ptrace(struct task_struct *child, long request,
148148
* Allows PTRACE_SYSCALL to work. These are called from entry.S in
149149
* {handle,ret_from}_syscall.
150150
*/
151-
void do_syscall_trace_enter(struct pt_regs *regs)
151+
__visible void do_syscall_trace_enter(struct pt_regs *regs)
152152
{
153153
if (test_thread_flag(TIF_SYSCALL_TRACE))
154154
if (tracehook_report_syscall_entry(regs))
@@ -162,7 +162,7 @@ void do_syscall_trace_enter(struct pt_regs *regs)
162162
audit_syscall_entry(regs->a7, regs->a0, regs->a1, regs->a2, regs->a3);
163163
}
164164

165-
void do_syscall_trace_exit(struct pt_regs *regs)
165+
__visible void do_syscall_trace_exit(struct pt_regs *regs)
166166
{
167167
audit_syscall_exit(regs);
168168

arch/riscv/kernel/signal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ static void do_signal(struct pt_regs *regs)
292292
* notification of userspace execution resumption
293293
* - triggered by the _TIF_WORK_MASK flags
294294
*/
295-
asmlinkage void do_notify_resume(struct pt_regs *regs,
296-
unsigned long thread_info_flags)
295+
asmlinkage __visible void do_notify_resume(struct pt_regs *regs,
296+
unsigned long thread_info_flags)
297297
{
298298
/* Handle pending signal delivery */
299299
if (thread_info_flags & _TIF_SIGPENDING)

arch/riscv/kernel/smpboot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
133133
/*
134134
* C entry point for a secondary processor.
135135
*/
136-
asmlinkage void __init smp_callin(void)
136+
asmlinkage __visible void __init smp_callin(void)
137137
{
138138
struct mm_struct *mm = &init_mm;
139139

arch/riscv/kernel/traps.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static void do_trap_error(struct pt_regs *regs, int signo, int code,
8484
}
8585

8686
#define DO_ERROR_INFO(name, signo, code, str) \
87-
asmlinkage void name(struct pt_regs *regs) \
87+
asmlinkage __visible void name(struct pt_regs *regs) \
8888
{ \
8989
do_trap_error(regs, signo, code, regs->sepc, "Oops - " str); \
9090
}
@@ -121,7 +121,7 @@ static inline unsigned long get_break_insn_length(unsigned long pc)
121121
return (((insn & __INSN_LENGTH_MASK) == __INSN_LENGTH_32) ? 4UL : 2UL);
122122
}
123123

124-
asmlinkage void do_trap_break(struct pt_regs *regs)
124+
asmlinkage __visible void do_trap_break(struct pt_regs *regs)
125125
{
126126
if (user_mode(regs))
127127
force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->sepc);

0 commit comments

Comments
 (0)