Skip to content

Commit a4b4382

Browse files
btw616richardweinberger
authored andcommitted
um: Move declarations to proper headers
This will address below -Wmissing-prototypes warnings: arch/um/kernel/initrd.c:18:12: warning: no previous prototype for ‘read_initrd’ [-Wmissing-prototypes] arch/um/kernel/um_arch.c:408:19: warning: no previous prototype for ‘read_initrd’ [-Wmissing-prototypes] arch/um/os-Linux/start_up.c:301:12: warning: no previous prototype for ‘parse_iomem’ [-Wmissing-prototypes] arch/x86/um/ptrace_32.c:15:6: warning: no previous prototype for ‘arch_switch_to’ [-Wmissing-prototypes] arch/x86/um/ptrace_32.c:101:5: warning: no previous prototype for ‘poke_user’ [-Wmissing-prototypes] arch/x86/um/ptrace_32.c:153:5: warning: no previous prototype for ‘peek_user’ [-Wmissing-prototypes] arch/x86/um/ptrace_64.c:111:5: warning: no previous prototype for ‘poke_user’ [-Wmissing-prototypes] arch/x86/um/ptrace_64.c:171:5: warning: no previous prototype for ‘peek_user’ [-Wmissing-prototypes] arch/x86/um/syscalls_64.c:48:6: warning: no previous prototype for ‘arch_switch_to’ [-Wmissing-prototypes] arch/x86/um/tls_32.c:184:5: warning: no previous prototype for ‘arch_switch_tls’ [-Wmissing-prototypes] Signed-off-by: Tiwei Bie <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 9ffc672 commit a4b4382

File tree

9 files changed

+14
-9
lines changed

9 files changed

+14
-9
lines changed

arch/um/include/asm/ptrace-generic.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ extern long subarch_ptrace(struct task_struct *child, long request,
3636
extern unsigned long getreg(struct task_struct *child, int regno);
3737
extern int putreg(struct task_struct *child, int regno, unsigned long value);
3838

39+
extern int poke_user(struct task_struct *child, long addr, long data);
40+
extern int peek_user(struct task_struct *child, long addr, long data);
41+
3942
extern int arch_set_tls(struct task_struct *new, unsigned long tls);
4043
extern void clear_flushed_tls(struct task_struct *task);
4144
extern int syscall_trace_enter(struct pt_regs *regs);

arch/um/include/shared/kern_util.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ extern void uml_pm_wake(void);
4141

4242
extern int start_uml(void);
4343
extern void paging_init(void);
44+
extern int parse_iomem(char *str, int *add);
4445

4546
extern void uml_cleanup(void);
4647
extern void do_uml_exitcalls(void);

arch/um/kernel/physmem.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <as-layout.h>
1313
#include <init.h>
1414
#include <kern.h>
15+
#include <kern_util.h>
1516
#include <mem_user.h>
1617
#include <os.h>
1718

@@ -161,8 +162,6 @@ __uml_setup("mem=", uml_mem_setup,
161162
" Example: mem=64M\n\n"
162163
);
163164

164-
extern int __init parse_iomem(char *str, int *add);
165-
166165
__uml_setup("iomem=", parse_iomem,
167166
"iomem=<name>,<file>\n"
168167
" Configure <file> as an IO memory region named <name>.\n\n"

arch/um/kernel/process.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ static inline void set_current(struct task_struct *task)
7474
{ external_pid(), task });
7575
}
7676

77-
extern void arch_switch_to(struct task_struct *to);
78-
7977
struct task_struct *__switch_to(struct task_struct *from, struct task_struct *to)
8078
{
8179
to->thread.prev_sched = from;

arch/um/kernel/ptrace.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ void ptrace_disable(struct task_struct *child)
3535
user_disable_single_step(child);
3636
}
3737

38-
extern int peek_user(struct task_struct * child, long addr, long data);
39-
extern int poke_user(struct task_struct * child, long addr, long data);
40-
4138
long arch_ptrace(struct task_struct *child, long request,
4239
unsigned long addr, unsigned long data)
4340
{

arch/um/kernel/um_arch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ extern void __init uml_dtb_init(void);
1111
static inline void uml_dtb_init(void) { }
1212
#endif
1313

14+
extern int __init read_initrd(void);
15+
1416
#endif

arch/um/os-Linux/start_up.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <asm/unistd.h>
2121
#include <init.h>
2222
#include <os.h>
23+
#include <kern_util.h>
2324
#include <mem_user.h>
2425
#include <ptrace_user.h>
2526
#include <registers.h>

arch/x86/um/asm/ptrace.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ extern int ptrace_get_thread_area(struct task_struct *child, int idx,
5454
extern int ptrace_set_thread_area(struct task_struct *child, int idx,
5555
struct user_desc __user *user_desc);
5656

57+
extern int arch_switch_tls(struct task_struct *to);
58+
5759
#else
5860

5961
#define PT_REGS_R8(r) UPT_R8(&(r)->regs)
@@ -83,5 +85,9 @@ extern long arch_prctl(struct task_struct *task, int option,
8385
unsigned long __user *addr);
8486

8587
#endif
88+
8689
#define user_stack_pointer(regs) PT_REGS_SP(regs)
90+
91+
extern void arch_switch_to(struct task_struct *to);
92+
8793
#endif /* __UM_X86_PTRACE_H */

arch/x86/um/ptrace_32.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#include <registers.h>
1111
#include <skas.h>
1212

13-
extern int arch_switch_tls(struct task_struct *to);
14-
1513
void arch_switch_to(struct task_struct *to)
1614
{
1715
int err = arch_switch_tls(to);

0 commit comments

Comments
 (0)