aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2006-06-25 08:47:41 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:01:06 -0400
commit83cc5ed3c4c65fc4c3729a5cec2111ede1ebf85e (patch)
treeea2b6b04117ad88c41a5059bdaf36a7a505808c0
parent76a8ad293912cd2f01eca075d80cd0ddec30c627 (diff)
[PATCH] kernel/sys.c: cleanups
- proper prototypes for the following functions: - ctrl_alt_del() (in include/linux/reboot.h) - getrusage() (in include/linux/resource.h) - make the following needlessly global functions static: - kernel_restart_prepare() - kernel_kexec() [akpm@osdl.org: compile fix] Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/arm/mach-ixp4xx/nas100d-power.c3
-rw-r--r--arch/arm/mach-ixp4xx/nslu2-power.c3
-rw-r--r--arch/mips/kernel/irixsig.c3
-rw-r--r--arch/mips/kernel/sysirix.c2
-rw-r--r--arch/um/drivers/mconsole_kern.c2
-rw-r--r--drivers/char/keyboard.c1
-rw-r--r--drivers/s390/char/sclp_quiesce.c3
-rw-r--r--include/linux/reboot.h4
-rw-r--r--include/linux/resource.h4
-rw-r--r--kernel/exit.c3
-rw-r--r--kernel/sys.c5
11 files changed, 15 insertions, 18 deletions
diff --git a/arch/arm/mach-ixp4xx/nas100d-power.c b/arch/arm/mach-ixp4xx/nas100d-power.c
index 99d333d7ebdd..a3745ed37f9f 100644
--- a/arch/arm/mach-ixp4xx/nas100d-power.c
+++ b/arch/arm/mach-ixp4xx/nas100d-power.c
@@ -20,11 +20,10 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/reboot.h> 21#include <linux/reboot.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/reboot.h>
23 24
24#include <asm/mach-types.h> 25#include <asm/mach-types.h>
25 26
26extern void ctrl_alt_del(void);
27
28static irqreturn_t nas100d_reset_handler(int irq, void *dev_id, struct pt_regs *regs) 27static irqreturn_t nas100d_reset_handler(int irq, void *dev_id, struct pt_regs *regs)
29{ 28{
30 /* Signal init to do the ctrlaltdel action, this will bypass init if 29 /* Signal init to do the ctrlaltdel action, this will bypass init if
diff --git a/arch/arm/mach-ixp4xx/nslu2-power.c b/arch/arm/mach-ixp4xx/nslu2-power.c
index d80c362bc539..6d38e97142cc 100644
--- a/arch/arm/mach-ixp4xx/nslu2-power.c
+++ b/arch/arm/mach-ixp4xx/nslu2-power.c
@@ -20,11 +20,10 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/reboot.h> 21#include <linux/reboot.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/reboot.h>
23 24
24#include <asm/mach-types.h> 25#include <asm/mach-types.h>
25 26
26extern void ctrl_alt_del(void);
27
28static irqreturn_t nslu2_power_handler(int irq, void *dev_id, struct pt_regs *regs) 27static irqreturn_t nslu2_power_handler(int irq, void *dev_id, struct pt_regs *regs)
29{ 28{
30 /* Signal init to do the ctrlaltdel action, this will bypass init if 29 /* Signal init to do the ctrlaltdel action, this will bypass init if
diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c
index a9bf6cc3abd1..676e868d26fb 100644
--- a/arch/mips/kernel/irixsig.c
+++ b/arch/mips/kernel/irixsig.c
@@ -13,6 +13,7 @@
13#include <linux/smp_lock.h> 13#include <linux/smp_lock.h>
14#include <linux/time.h> 14#include <linux/time.h>
15#include <linux/ptrace.h> 15#include <linux/ptrace.h>
16#include <linux/resource.h>
16 17
17#include <asm/ptrace.h> 18#include <asm/ptrace.h>
18#include <asm/uaccess.h> 19#include <asm/uaccess.h>
@@ -540,8 +541,6 @@ out:
540#define IRIX_P_PGID 2 541#define IRIX_P_PGID 2
541#define IRIX_P_ALL 7 542#define IRIX_P_ALL 7
542 543
543extern int getrusage(struct task_struct *, int, struct rusage __user *);
544
545#define W_EXITED 1 544#define W_EXITED 1
546#define W_TRAPPED 2 545#define W_TRAPPED 2
547#define W_STOPPED 4 546#define W_STOPPED 4
diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c
index 19e1ef43eb4b..1137dd6ea7aa 100644
--- a/arch/mips/kernel/sysirix.c
+++ b/arch/mips/kernel/sysirix.c
@@ -31,6 +31,7 @@
31#include <linux/socket.h> 31#include <linux/socket.h>
32#include <linux/security.h> 32#include <linux/security.h>
33#include <linux/syscalls.h> 33#include <linux/syscalls.h>
34#include <linux/resource.h>
34 35
35#include <asm/ptrace.h> 36#include <asm/ptrace.h>
36#include <asm/page.h> 37#include <asm/page.h>
@@ -235,7 +236,6 @@ asmlinkage int irix_prctl(unsigned option, ...)
235#undef DEBUG_PROCGRPS 236#undef DEBUG_PROCGRPS
236 237
237extern unsigned long irix_mapelf(int fd, struct elf_phdr __user *user_phdrp, int cnt); 238extern unsigned long irix_mapelf(int fd, struct elf_phdr __user *user_phdrp, int cnt);
238extern int getrusage(struct task_struct *p, int who, struct rusage __user *ru);
239extern char *prom_getenv(char *name); 239extern char *prom_getenv(char *name);
240extern long prom_setenv(char *name, char *value); 240extern long prom_setenv(char *name, char *value);
241 241
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index 6d7173fc55a3..79149314ed04 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -300,8 +300,6 @@ void mconsole_reboot(struct mc_request *req)
300 machine_restart(NULL); 300 machine_restart(NULL);
301} 301}
302 302
303extern void ctrl_alt_del(void);
304
305void mconsole_cad(struct mc_request *req) 303void mconsole_cad(struct mc_request *req)
306{ 304{
307 mconsole_reply(req, "", 0, 0); 305 mconsole_reply(req, "", 0, 0);
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 5755b7e5f187..edd996f6fb87 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -39,6 +39,7 @@
39#include <linux/vt_kern.h> 39#include <linux/vt_kern.h>
40#include <linux/sysrq.h> 40#include <linux/sysrq.h>
41#include <linux/input.h> 41#include <linux/input.h>
42#include <linux/reboot.h>
42 43
43static void kbd_disconnect(struct input_handle *handle); 44static void kbd_disconnect(struct input_handle *handle);
44extern void ctrl_alt_del(void); 45extern void ctrl_alt_del(void);
diff --git a/drivers/s390/char/sclp_quiesce.c b/drivers/s390/char/sclp_quiesce.c
index 56fa69168898..a4c53c172db6 100644
--- a/drivers/s390/char/sclp_quiesce.c
+++ b/drivers/s390/char/sclp_quiesce.c
@@ -13,6 +13,7 @@
13#include <linux/cpumask.h> 13#include <linux/cpumask.h>
14#include <linux/smp.h> 14#include <linux/smp.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/reboot.h>
16#include <asm/atomic.h> 17#include <asm/atomic.h>
17#include <asm/ptrace.h> 18#include <asm/ptrace.h>
18#include <asm/sigp.h> 19#include <asm/sigp.h>
@@ -66,8 +67,6 @@ do_machine_quiesce(void)
66} 67}
67#endif 68#endif
68 69
69extern void ctrl_alt_del(void);
70
71/* Handler for quiesce event. Start shutdown procedure. */ 70/* Handler for quiesce event. Start shutdown procedure. */
72static void 71static void
73sclp_quiesce_handler(struct evbuf_header *evbuf) 72sclp_quiesce_handler(struct evbuf_header *evbuf)
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 015297ff73fa..1dd1c707311f 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -59,13 +59,13 @@ extern void machine_crash_shutdown(struct pt_regs *);
59 * Architecture independent implemenations of sys_reboot commands. 59 * Architecture independent implemenations of sys_reboot commands.
60 */ 60 */
61 61
62extern void kernel_restart_prepare(char *cmd);
63extern void kernel_shutdown_prepare(enum system_states state); 62extern void kernel_shutdown_prepare(enum system_states state);
64 63
65extern void kernel_restart(char *cmd); 64extern void kernel_restart(char *cmd);
66extern void kernel_halt(void); 65extern void kernel_halt(void);
67extern void kernel_power_off(void); 66extern void kernel_power_off(void);
68extern void kernel_kexec(void); 67
68void ctrl_alt_del(void);
69 69
70/* 70/*
71 * Emergency restart, callable from an interrupt handler. 71 * Emergency restart, callable from an interrupt handler.
diff --git a/include/linux/resource.h b/include/linux/resource.h
index 21a86cb6acdb..ae13db714742 100644
--- a/include/linux/resource.h
+++ b/include/linux/resource.h
@@ -3,6 +3,8 @@
3 3
4#include <linux/time.h> 4#include <linux/time.h>
5 5
6struct task_struct;
7
6/* 8/*
7 * Resource control/accounting header file for linux 9 * Resource control/accounting header file for linux
8 */ 10 */
@@ -67,4 +69,6 @@ struct rlimit {
67 */ 69 */
68#include <asm/resource.h> 70#include <asm/resource.h>
69 71
72int getrusage(struct task_struct *p, int who, struct rusage __user *ru);
73
70#endif 74#endif
diff --git a/kernel/exit.c b/kernel/exit.c
index a3baf92462bd..b12a4706f73f 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -36,6 +36,7 @@
36#include <linux/compat.h> 36#include <linux/compat.h>
37#include <linux/pipe_fs_i.h> 37#include <linux/pipe_fs_i.h>
38#include <linux/audit.h> /* for audit_free() */ 38#include <linux/audit.h> /* for audit_free() */
39#include <linux/resource.h>
39 40
40#include <asm/uaccess.h> 41#include <asm/uaccess.h>
41#include <asm/unistd.h> 42#include <asm/unistd.h>
@@ -45,8 +46,6 @@
45extern void sem_exit (void); 46extern void sem_exit (void);
46extern struct task_struct *child_reaper; 47extern struct task_struct *child_reaper;
47 48
48int getrusage(struct task_struct *, int, struct rusage __user *);
49
50static void exit_mm(struct task_struct * tsk); 49static void exit_mm(struct task_struct * tsk);
51 50
52static void __unhash_process(struct task_struct *p) 51static void __unhash_process(struct task_struct *p)
diff --git a/kernel/sys.c b/kernel/sys.c
index 7e0927bad713..2d5179c67cec 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -589,7 +589,7 @@ void emergency_restart(void)
589} 589}
590EXPORT_SYMBOL_GPL(emergency_restart); 590EXPORT_SYMBOL_GPL(emergency_restart);
591 591
592void kernel_restart_prepare(char *cmd) 592static void kernel_restart_prepare(char *cmd)
593{ 593{
594 blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd); 594 blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd);
595 system_state = SYSTEM_RESTART; 595 system_state = SYSTEM_RESTART;
@@ -623,7 +623,7 @@ EXPORT_SYMBOL_GPL(kernel_restart);
623 * Move into place and start executing a preloaded standalone 623 * Move into place and start executing a preloaded standalone
624 * executable. If nothing was preloaded return an error. 624 * executable. If nothing was preloaded return an error.
625 */ 625 */
626void kernel_kexec(void) 626static void kernel_kexec(void)
627{ 627{
628#ifdef CONFIG_KEXEC 628#ifdef CONFIG_KEXEC
629 struct kimage *image; 629 struct kimage *image;
@@ -637,7 +637,6 @@ void kernel_kexec(void)
637 machine_kexec(image); 637 machine_kexec(image);
638#endif 638#endif
639} 639}
640EXPORT_SYMBOL_GPL(kernel_kexec);
641 640
642void kernel_shutdown_prepare(enum system_states state) 641void kernel_shutdown_prepare(enum system_states state)
643{ 642{