Skip to content

Commit 99764fa

Browse files
congwangtorvalds
authored andcommitted
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>
1 parent 4a56758 commit 99764fa

14 files changed

Lines changed: 12 additions & 26 deletions

File tree

‎arch/um/include/skas/skas.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ extern int user_thread(unsigned long stack, int flags);
1616
extern void new_thread_handler(void);
1717
extern void handle_syscall(struct uml_pt_regs *regs);
1818
extern int new_mm(unsigned long stack);
19-
extern void get_skas_faultinfo(int pid, struct faultinfo * fi);
2019
extern long execute_syscall_skas(void *r);
2120
extern unsigned long current_stub_stack(void);
2221

‎arch/um/include/um_uaccess.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ extern int copy_to_user(void __user *to, const void *from, int n);
3434

3535
extern int __do_copy_to_user(void *to, const void *from, int n,
3636
void **fault_addr, jmp_buf **fault_catcher);
37-
extern void __do_copy(void *to, const void *from, int n);
3837

3938
/*
4039
* strncpy_from_user: - Copy a NUL terminated string from userspace.

‎arch/um/kernel/physmem.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ unsigned long find_iomem(char *driver, unsigned long *len_out)
185185
return 0;
186186
}
187187

188-
int setup_iomem(void)
188+
static int setup_iomem(void)
189189
{
190190
struct iomem_region *region = iomem_regions;
191191
unsigned long iomem_start = high_physmem + PAGE_SIZE;

‎arch/um/kernel/ptrace.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
225225
return ret;
226226
}
227227

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,
229229
int error_code)
230230
{
231231
struct siginfo info;

‎arch/um/kernel/time.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@
1313
#include "kern_util.h"
1414
#include "os.h"
1515

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-
2416
void timer_handler(int sig, struct uml_pt_regs *regs)
2517
{
2618
unsigned long flags;

‎arch/um/kernel/uaccess.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <linux/string.h>
1313
#include "os.h"
1414

15-
void __do_copy(void *to, const void *from, int n)
15+
static void __do_copy(void *to, const void *from, int n)
1616
{
1717
memcpy(to, from, n);
1818
}

‎arch/um/os-Linux/sigio.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ static void tty_close(int master, int slave)
530530
printk(UM_KERN_CONT "No, enabling workaround\n");
531531
}
532532

533-
void __init check_sigio(void)
533+
static void __init check_sigio(void)
534534
{
535535
if ((access("/dev/ptmx", R_OK) < 0) &&
536536
(access("/dev/ptyp0", R_OK) < 0)) {

‎arch/um/os-Linux/signal.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void set_sigstack(void *sig_stack, int size)
126126
panic("enabling signal stack failed, errno = %d\n", errno);
127127
}
128128

129-
void (*handlers[_NSIG])(int sig, struct sigcontext *sc);
129+
static void (*handlers[_NSIG])(int sig, struct sigcontext *sc);
130130

131131
void handle_signal(int sig, struct sigcontext *sc)
132132
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void wait_stub_done(int pid)
9696

9797
extern unsigned long current_stub_stack(void);
9898

99-
void get_skas_faultinfo(int pid, struct faultinfo * fi)
99+
static void get_skas_faultinfo(int pid, struct faultinfo *fi)
100100
{
101101
int err;
102102

‎arch/um/os-Linux/umid.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ int __init set_umid(char *name)
245245
/* Changed in make_umid, which is called during early boot */
246246
static int umid_setup = 0;
247247

248-
int __init make_umid(void)
248+
static int __init make_umid(void)
249249
{
250250
int fd, err;
251251
char tmp[256];

0 commit comments

Comments
 (0)