Skip to content

Commit

Permalink
[PATCH] kernel/sys.c: cleanups
Browse files Browse the repository at this point in the history
- 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()

[[email protected]: compile fix]
Signed-off-by: Adrian Bunk <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
AdrianBunk authored and Linus Torvalds committed Jun 25, 2006
1 parent 76a8ad2 commit 83cc5ed
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 18 deletions.
3 changes: 1 addition & 2 deletions arch/arm/mach-ixp4xx/nas100d-power.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
#include <linux/module.h>
#include <linux/reboot.h>
#include <linux/interrupt.h>
#include <linux/reboot.h>

#include <asm/mach-types.h>

extern void ctrl_alt_del(void);

static irqreturn_t nas100d_reset_handler(int irq, void *dev_id, struct pt_regs *regs)
{
/* Signal init to do the ctrlaltdel action, this will bypass init if
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-ixp4xx/nslu2-power.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
#include <linux/module.h>
#include <linux/reboot.h>
#include <linux/interrupt.h>
#include <linux/reboot.h>

#include <asm/mach-types.h>

extern void ctrl_alt_del(void);

static irqreturn_t nslu2_power_handler(int irq, void *dev_id, struct pt_regs *regs)
{
/* Signal init to do the ctrlaltdel action, this will bypass init if
Expand Down
3 changes: 1 addition & 2 deletions arch/mips/kernel/irixsig.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/smp_lock.h>
#include <linux/time.h>
#include <linux/ptrace.h>
#include <linux/resource.h>

#include <asm/ptrace.h>
#include <asm/uaccess.h>
Expand Down Expand Up @@ -540,8 +541,6 @@ asmlinkage int irix_sigpoll_sys(unsigned long __user *set,
#define IRIX_P_PGID 2
#define IRIX_P_ALL 7

extern int getrusage(struct task_struct *, int, struct rusage __user *);

#define W_EXITED 1
#define W_TRAPPED 2
#define W_STOPPED 4
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/sysirix.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/socket.h>
#include <linux/security.h>
#include <linux/syscalls.h>
#include <linux/resource.h>

#include <asm/ptrace.h>
#include <asm/page.h>
Expand Down Expand Up @@ -235,7 +236,6 @@ asmlinkage int irix_prctl(unsigned option, ...)
#undef DEBUG_PROCGRPS

extern unsigned long irix_mapelf(int fd, struct elf_phdr __user *user_phdrp, int cnt);
extern int getrusage(struct task_struct *p, int who, struct rusage __user *ru);
extern char *prom_getenv(char *name);
extern long prom_setenv(char *name, char *value);

Expand Down
2 changes: 0 additions & 2 deletions arch/um/drivers/mconsole_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,6 @@ void mconsole_reboot(struct mc_request *req)
machine_restart(NULL);
}

extern void ctrl_alt_del(void);

void mconsole_cad(struct mc_request *req)
{
mconsole_reply(req, "", 0, 0);
Expand Down
1 change: 1 addition & 0 deletions drivers/char/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <linux/vt_kern.h>
#include <linux/sysrq.h>
#include <linux/input.h>
#include <linux/reboot.h>

static void kbd_disconnect(struct input_handle *handle);
extern void ctrl_alt_del(void);
Expand Down
3 changes: 1 addition & 2 deletions drivers/s390/char/sclp_quiesce.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/cpumask.h>
#include <linux/smp.h>
#include <linux/init.h>
#include <linux/reboot.h>
#include <asm/atomic.h>
#include <asm/ptrace.h>
#include <asm/sigp.h>
Expand Down Expand Up @@ -66,8 +67,6 @@ do_machine_quiesce(void)
}
#endif

extern void ctrl_alt_del(void);

/* Handler for quiesce event. Start shutdown procedure. */
static void
sclp_quiesce_handler(struct evbuf_header *evbuf)
Expand Down
4 changes: 2 additions & 2 deletions include/linux/reboot.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ extern void machine_crash_shutdown(struct pt_regs *);
* Architecture independent implemenations of sys_reboot commands.
*/

extern void kernel_restart_prepare(char *cmd);
extern void kernel_shutdown_prepare(enum system_states state);

extern void kernel_restart(char *cmd);
extern void kernel_halt(void);
extern void kernel_power_off(void);
extern void kernel_kexec(void);

void ctrl_alt_del(void);

/*
* Emergency restart, callable from an interrupt handler.
Expand Down
4 changes: 4 additions & 0 deletions include/linux/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <linux/time.h>

struct task_struct;

/*
* Resource control/accounting header file for linux
*/
Expand Down Expand Up @@ -67,4 +69,6 @@ struct rlimit {
*/
#include <asm/resource.h>

int getrusage(struct task_struct *p, int who, struct rusage __user *ru);

#endif
3 changes: 1 addition & 2 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <linux/compat.h>
#include <linux/pipe_fs_i.h>
#include <linux/audit.h> /* for audit_free() */
#include <linux/resource.h>

#include <asm/uaccess.h>
#include <asm/unistd.h>
Expand All @@ -45,8 +46,6 @@
extern void sem_exit (void);
extern struct task_struct *child_reaper;

int getrusage(struct task_struct *, int, struct rusage __user *);

static void exit_mm(struct task_struct * tsk);

static void __unhash_process(struct task_struct *p)
Expand Down
5 changes: 2 additions & 3 deletions kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ void emergency_restart(void)
}
EXPORT_SYMBOL_GPL(emergency_restart);

void kernel_restart_prepare(char *cmd)
static void kernel_restart_prepare(char *cmd)
{
blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd);
system_state = SYSTEM_RESTART;
Expand Down Expand Up @@ -623,7 +623,7 @@ EXPORT_SYMBOL_GPL(kernel_restart);
* Move into place and start executing a preloaded standalone
* executable. If nothing was preloaded return an error.
*/
void kernel_kexec(void)
static void kernel_kexec(void)
{
#ifdef CONFIG_KEXEC
struct kimage *image;
Expand All @@ -637,7 +637,6 @@ void kernel_kexec(void)
machine_kexec(image);
#endif
}
EXPORT_SYMBOL_GPL(kernel_kexec);

void kernel_shutdown_prepare(enum system_states state)
{
Expand Down

0 comments on commit 83cc5ed

Please sign in to comment.