Skip to content

Commit 847d3ab

Browse files
btw616richardweinberger
authored andcommitted
um: Add an internal header shared among the user code
Move relevant declarations to this header. This will address below -Wmissing-prototypes warnings: arch/um/os-Linux/elf_aux.c:26:13: warning: no previous prototype for ‘scan_elf_aux’ [-Wmissing-prototypes] arch/um/os-Linux/mem.c:213:13: warning: no previous prototype for ‘check_tmpexec’ [-Wmissing-prototypes] arch/um/os-Linux/skas/process.c:107:6: warning: no previous prototype for ‘wait_stub_done’ [-Wmissing-prototypes] Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 6a85e34 commit 847d3ab

File tree

7 files changed

+26
-6
lines changed

7 files changed

+26
-6
lines changed

arch/um/os-Linux/elf_aux.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <init.h>
1414
#include <elf_user.h>
1515
#include <mem_user.h>
16+
#include "internal.h"
1617

1718
typedef Elf32_auxv_t elf_auxv_t;
1819

arch/um/os-Linux/internal.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef __UM_OS_LINUX_INTERNAL_H
3+
#define __UM_OS_LINUX_INTERNAL_H
4+
5+
/*
6+
* elf_aux.c
7+
*/
8+
void scan_elf_aux(char **envp);
9+
10+
/*
11+
* mem.c
12+
*/
13+
void check_tmpexec(void);
14+
15+
/*
16+
* skas/process.c
17+
*/
18+
void wait_stub_done(int pid);
19+
20+
#endif /* __UM_OS_LINUX_INTERNAL_H */

arch/um/os-Linux/main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <kern_util.h>
1717
#include <os.h>
1818
#include <um_malloc.h>
19+
#include "internal.h"
1920

2021
#define PGD_BOUND (4 * 1024 * 1024)
2122
#define STACKSIZE (8 * 1024 * 1024)
@@ -102,8 +103,6 @@ static void setup_env_path(void)
102103
}
103104
}
104105

105-
extern void scan_elf_aux( char **envp);
106-
107106
int __init main(int argc, char **argv, char **envp)
108107
{
109108
char **new_argv;

arch/um/os-Linux/mem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <init.h>
1818
#include <kern_util.h>
1919
#include <os.h>
20+
#include "internal.h"
2021

2122
/*
2223
* kasan_map_memory - maps memory from @start with a size of @len.

arch/um/os-Linux/skas/mem.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717
#include <skas.h>
1818
#include <sysdep/ptrace.h>
1919
#include <sysdep/stub.h>
20+
#include "../internal.h"
2021

2122
extern char batch_syscall_stub[], __syscall_stub_start[];
2223

23-
extern void wait_stub_done(int pid);
24-
2524
static inline unsigned long *check_init_stack(struct mm_id * mm_idp,
2625
unsigned long *stack)
2726
{

arch/um/os-Linux/skas/process.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <skas.h>
2424
#include <sysdep/stub.h>
2525
#include <linux/threads.h>
26+
#include "../internal.h"
2627

2728
int is_skas_winch(int pid, int fd, void *data)
2829
{

arch/um/os-Linux/start_up.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <ptrace_user.h>
2626
#include <registers.h>
2727
#include <skas.h>
28+
#include "internal.h"
2829

2930
static void ptrace_child(void)
3031
{
@@ -222,8 +223,6 @@ static void __init check_ptrace(void)
222223
check_sysemu();
223224
}
224225

225-
extern void check_tmpexec(void);
226-
227226
static void __init check_coredump_limit(void)
228227
{
229228
struct rlimit lim;

0 commit comments

Comments
 (0)