Skip to content

Commit 53471c5

Browse files
btw616richardweinberger
authored andcommitted
um: Make local functions and variables static
This will also fix the warnings like: warning: no previous prototype for ‘fork_handler’ [-Wmissing-prototypes] 140 | void fork_handler(void) | ^~~~~~~~~~~~ Signed-off-by: Tiwei Bie <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 31a5990 commit 53471c5

File tree

10 files changed

+17
-17
lines changed

10 files changed

+17
-17
lines changed

arch/um/drivers/pcap_kern.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct pcap_init {
1515
char *filter;
1616
};
1717

18-
void pcap_init_kern(struct net_device *dev, void *data)
18+
static void pcap_init_kern(struct net_device *dev, void *data)
1919
{
2020
struct uml_net_private *pri;
2121
struct pcap_data *ppri;
@@ -50,7 +50,7 @@ static const struct net_kern_info pcap_kern_info = {
5050
.write = pcap_write,
5151
};
5252

53-
int pcap_setup(char *str, char **mac_out, void *data)
53+
static int pcap_setup(char *str, char **mac_out, void *data)
5454
{
5555
struct pcap_init *init = data;
5656
char *remain, *host_if = NULL, *options[2] = { NULL, NULL };

arch/um/drivers/ubd_user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <os.h>
2424
#include <poll.h>
2525

26-
struct pollfd kernel_pollfd;
26+
static struct pollfd kernel_pollfd;
2727

2828
int start_io_thread(unsigned long sp, int *fd_out)
2929
{

arch/um/kernel/kmsg_dump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static struct kmsg_dumper kmsg_dumper = {
5757
.dump = kmsg_dumper_stdout
5858
};
5959

60-
int __init kmsg_dumper_stdout_init(void)
60+
static int __init kmsg_dumper_stdout_init(void)
6161
{
6262
return kmsg_dump_register(&kmsg_dumper);
6363
}

arch/um/kernel/process.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void new_thread_handler(void)
137137
}
138138

139139
/* Called magically, see new_thread_handler above */
140-
void fork_handler(void)
140+
static void fork_handler(void)
141141
{
142142
force_flush_all();
143143

@@ -268,14 +268,14 @@ int clear_user_proc(void __user *buf, int size)
268268
static atomic_t using_sysemu = ATOMIC_INIT(0);
269269
int sysemu_supported;
270270

271-
void set_using_sysemu(int value)
271+
static void set_using_sysemu(int value)
272272
{
273273
if (value > sysemu_supported)
274274
return;
275275
atomic_set(&using_sysemu, value);
276276
}
277277

278-
int get_using_sysemu(void)
278+
static int get_using_sysemu(void)
279279
{
280280
return atomic_read(&using_sysemu);
281281
}
@@ -313,7 +313,7 @@ static const struct proc_ops sysemu_proc_ops = {
313313
.proc_write = sysemu_proc_write,
314314
};
315315

316-
int __init make_proc_sysemu(void)
316+
static int __init make_proc_sysemu(void)
317317
{
318318
struct proc_dir_entry *ent;
319319
if (!sysemu_supported)

arch/um/kernel/time.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ void time_travel_add_event_rel(struct time_travel_event *e,
319319
time_travel_add_event(e, time_travel_time + delay_ns);
320320
}
321321

322-
void time_travel_periodic_timer(struct time_travel_event *e)
322+
static void time_travel_periodic_timer(struct time_travel_event *e)
323323
{
324324
time_travel_add_event(&time_travel_timer_event,
325325
time_travel_time + time_travel_timer_interval);
@@ -812,7 +812,7 @@ unsigned long calibrate_delay_is_known(void)
812812
return 0;
813813
}
814814

815-
int setup_time_travel(char *str)
815+
static int setup_time_travel(char *str)
816816
{
817817
if (strcmp(str, "=inf-cpu") == 0) {
818818
time_travel_mode = TT_MODE_INFCPU;
@@ -862,7 +862,7 @@ __uml_help(setup_time_travel,
862862
"devices using it, assuming the device has the right capabilities.\n"
863863
"The optional ID is a 64-bit integer that's sent to the central scheduler.\n");
864864

865-
int setup_time_travel_start(char *str)
865+
static int setup_time_travel_start(char *str)
866866
{
867867
int err;
868868

arch/um/os-Linux/drivers/ethertap_kern.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const struct net_kern_info ethertap_kern_info = {
6363
.write = etap_write,
6464
};
6565

66-
int ethertap_setup(char *str, char **mac_out, void *data)
66+
static int ethertap_setup(char *str, char **mac_out, void *data)
6767
{
6868
struct ethertap_init *init = data;
6969

arch/um/os-Linux/drivers/tuntap_kern.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const struct net_kern_info tuntap_kern_info = {
5353
.write = tuntap_write,
5454
};
5555

56-
int tuntap_setup(char *str, char **mac_out, void *data)
56+
static int tuntap_setup(char *str, char **mac_out, void *data)
5757
{
5858
struct tuntap_init *init = data;
5959

arch/um/os-Linux/signal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static int signals_blocked;
7272
static unsigned int signals_pending;
7373
static unsigned int signals_active = 0;
7474

75-
void sig_handler(int sig, struct siginfo *si, mcontext_t *mc)
75+
static void sig_handler(int sig, struct siginfo *si, mcontext_t *mc)
7676
{
7777
int enabled = signals_enabled;
7878

@@ -108,7 +108,7 @@ static void timer_real_alarm_handler(mcontext_t *mc)
108108
timer_handler(SIGALRM, NULL, &regs);
109109
}
110110

111-
void timer_alarm_handler(int sig, struct siginfo *unused_si, mcontext_t *mc)
111+
static void timer_alarm_handler(int sig, struct siginfo *unused_si, mcontext_t *mc)
112112
{
113113
int enabled;
114114

arch/x86/um/os-Linux/registers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <linux/elf.h>
1818
#include <registers.h>
1919

20-
int have_xstate_support;
20+
static int have_xstate_support;
2121

2222
int save_i387_registers(int pid, unsigned long *fp_regs)
2323
{

arch/x86/um/tls_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
static int host_supports_tls = -1;
2121
int host_gdt_entry_tls_min;
2222

23-
int do_set_thread_area(struct user_desc *info)
23+
static int do_set_thread_area(struct user_desc *info)
2424
{
2525
int ret;
2626
u32 cpu;

0 commit comments

Comments
 (0)