Commit 99764fa4ceeecba8b9e0a8a5565b418a2e94f83b

Authored by WANG Cong
Committed by Linus Torvalds
1 parent 4a56758204

UML: make several more things static

- Make some variables and functions static, since they don't need to be
  global.

- Remove an unused function - arch/um/kernel/time.c::sched_clock().

- Clean the style a bit as complained by checkpatch.pl.

Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: WANG Cong <wangcong@zeuux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 14 changed files with 12 additions and 26 deletions Side-by-side Diff

arch/um/include/skas/skas.h
... ... @@ -16,7 +16,6 @@
16 16 extern void new_thread_handler(void);
17 17 extern void handle_syscall(struct uml_pt_regs *regs);
18 18 extern int new_mm(unsigned long stack);
19   -extern void get_skas_faultinfo(int pid, struct faultinfo * fi);
20 19 extern long execute_syscall_skas(void *r);
21 20 extern unsigned long current_stub_stack(void);
22 21  
arch/um/include/um_uaccess.h
... ... @@ -34,7 +34,6 @@
34 34  
35 35 extern int __do_copy_to_user(void *to, const void *from, int n,
36 36 void **fault_addr, jmp_buf **fault_catcher);
37   -extern void __do_copy(void *to, const void *from, int n);
38 37  
39 38 /*
40 39 * strncpy_from_user: - Copy a NUL terminated string from userspace.
arch/um/kernel/physmem.c
... ... @@ -185,7 +185,7 @@
185 185 return 0;
186 186 }
187 187  
188   -int setup_iomem(void)
  188 +static int setup_iomem(void)
189 189 {
190 190 struct iomem_region *region = iomem_regions;
191 191 unsigned long iomem_start = high_physmem + PAGE_SIZE;
arch/um/kernel/ptrace.c
... ... @@ -225,7 +225,7 @@
225 225 return ret;
226 226 }
227 227  
228   -void send_sigtrap(struct task_struct *tsk, struct uml_pt_regs *regs,
  228 +static void send_sigtrap(struct task_struct *tsk, struct uml_pt_regs *regs,
229 229 int error_code)
230 230 {
231 231 struct siginfo info;
arch/um/kernel/time.c
... ... @@ -13,14 +13,6 @@
13 13 #include "kern_util.h"
14 14 #include "os.h"
15 15  
16   -/*
17   - * Scheduler clock - returns current time in nanosec units.
18   - */
19   -unsigned long long sched_clock(void)
20   -{
21   - return (unsigned long long)jiffies_64 * (NSEC_PER_SEC / HZ);
22   -}
23   -
24 16 void timer_handler(int sig, struct uml_pt_regs *regs)
25 17 {
26 18 unsigned long flags;
arch/um/kernel/uaccess.c
... ... @@ -12,7 +12,7 @@
12 12 #include <linux/string.h>
13 13 #include "os.h"
14 14  
15   -void __do_copy(void *to, const void *from, int n)
  15 +static void __do_copy(void *to, const void *from, int n)
16 16 {
17 17 memcpy(to, from, n);
18 18 }
arch/um/os-Linux/sigio.c
... ... @@ -530,7 +530,7 @@
530 530 printk(UM_KERN_CONT "No, enabling workaround\n");
531 531 }
532 532  
533   -void __init check_sigio(void)
  533 +static void __init check_sigio(void)
534 534 {
535 535 if ((access("/dev/ptmx", R_OK) < 0) &&
536 536 (access("/dev/ptyp0", R_OK) < 0)) {
arch/um/os-Linux/signal.c
... ... @@ -126,7 +126,7 @@
126 126 panic("enabling signal stack failed, errno = %d\n", errno);
127 127 }
128 128  
129   -void (*handlers[_NSIG])(int sig, struct sigcontext *sc);
  129 +static void (*handlers[_NSIG])(int sig, struct sigcontext *sc);
130 130  
131 131 void handle_signal(int sig, struct sigcontext *sc)
132 132 {
arch/um/os-Linux/skas/process.c
... ... @@ -96,7 +96,7 @@
96 96  
97 97 extern unsigned long current_stub_stack(void);
98 98  
99   -void get_skas_faultinfo(int pid, struct faultinfo * fi)
  99 +static void get_skas_faultinfo(int pid, struct faultinfo *fi)
100 100 {
101 101 int err;
102 102  
arch/um/os-Linux/umid.c
... ... @@ -245,7 +245,7 @@
245 245 /* Changed in make_umid, which is called during early boot */
246 246 static int umid_setup = 0;
247 247  
248   -int __init make_umid(void)
  248 +static int __init make_umid(void)
249 249 {
250 250 int fd, err;
251 251 char tmp[256];
arch/um/sys-i386/bugs.c
... ... @@ -12,7 +12,7 @@
12 12 #include "sysdep/ptrace.h"
13 13  
14 14 /* Set during early boot */
15   -int host_has_cmov = 1;
  15 +static int host_has_cmov = 1;
16 16 static jmp_buf cmov_test_return;
17 17  
18 18 static void cmov_sigill_test_handler(int sig)
arch/um/sys-i386/checksum.S
... ... @@ -243,13 +243,12 @@
243 243 .previous
244 244  
245 245 .align 4
246   -.globl csum_partial_copy_generic_i386
247   -
  246 +
248 247 #ifndef CONFIG_X86_USE_PPRO_CHECKSUM
249 248  
250 249 #define ARGBASE 16
251 250 #define FP 12
252   -
  251 +
253 252 csum_partial_copy_generic_i386:
254 253 subl $4,%esp
255 254 pushl %edi
arch/um/sys-i386/ldt.c
... ... @@ -14,8 +14,8 @@
14 14  
15 15 extern int modify_ldt(int func, void *ptr, unsigned long bytecount);
16 16  
17   -long write_ldt_entry(struct mm_id * mm_idp, int func, struct user_desc * desc,
18   - void **addr, int done)
  17 +static long write_ldt_entry(struct mm_id *mm_idp, int func,
  18 + struct user_desc *desc, void **addr, int done)
19 19 {
20 20 long res;
21 21  
include/asm-um/ptrace-generic.h
... ... @@ -47,9 +47,6 @@
47 47  
48 48 extern void show_regs(struct pt_regs *regs);
49 49  
50   -extern void send_sigtrap(struct task_struct *tsk, struct uml_pt_regs *regs,
51   - int error_code);
52   -
53 50 extern int arch_copy_tls(struct task_struct *new);
54 51 extern void clear_flushed_tls(struct task_struct *task);
55 52