From: Peter Chubb Currently, do_setitimer() is used in several files, but doesn;t appear in any header. Thus its declaration is repeated in some files, and its use causes a warning in others (because there is no declaration present). This patch: -- adds a couple of declarations to linux/times.h -- removes the (now duplicate) declarations from other files. arch/alpha/kernel/osf_sys.c | 2 -- arch/mips/kernel/sysirix.c | 3 --- arch/x86_64/ia32/sys_ia32.c | 2 -- include/linux/time.h | 3 +++ kernel/compat.c | 4 ---- kernel/itimer.c | 1 + kernel/timer.c | 2 -- 7 files changed, 4 insertions(+), 13 deletions(-) diff -puN arch/alpha/kernel/osf_sys.c~do_setitimer-cleanup arch/alpha/kernel/osf_sys.c --- 25/arch/alpha/kernel/osf_sys.c~do_setitimer-cleanup 2003-08-04 23:21:55.000000000 -0700 +++ 25-akpm/arch/alpha/kernel/osf_sys.c 2003-08-04 23:21:55.000000000 -0700 @@ -821,8 +821,6 @@ osf_setsysinfo(unsigned long op, void *b affects all sorts of things, like timeval and itimerval. */ extern struct timezone sys_tz; -extern int do_getitimer(int which, struct itimerval *value); -extern int do_setitimer(int which, struct itimerval *, struct itimerval *); extern asmlinkage int sys_utimes(char *, struct timeval *); extern int do_adjtimex(struct timex *); diff -puN arch/mips/kernel/sysirix.c~do_setitimer-cleanup arch/mips/kernel/sysirix.c --- 25/arch/mips/kernel/sysirix.c~do_setitimer-cleanup 2003-08-04 23:21:55.000000000 -0700 +++ 25-akpm/arch/mips/kernel/sysirix.c 2003-08-04 23:21:55.000000000 -0700 @@ -636,9 +636,6 @@ asmlinkage int irix_stime(int value) return 0; } -extern int do_setitimer(int which, struct itimerval *value, - struct itimerval *ovalue); - static inline void jiffiestotv(unsigned long jiffies, struct timeval *value) { value->tv_usec = (jiffies % HZ) * (1000000 / HZ); diff -puN arch/x86_64/ia32/sys_ia32.c~do_setitimer-cleanup arch/x86_64/ia32/sys_ia32.c --- 25/arch/x86_64/ia32/sys_ia32.c~do_setitimer-cleanup 2003-08-04 23:21:55.000000000 -0700 +++ 25-akpm/arch/x86_64/ia32/sys_ia32.c 2003-08-04 23:21:55.000000000 -0700 @@ -428,8 +428,6 @@ put_tv32(struct compat_timeval *o, struc return err; } -extern int do_setitimer(int which, struct itimerval *, struct itimerval *); - asmlinkage long sys32_alarm(unsigned int seconds) { diff -puN include/linux/time.h~do_setitimer-cleanup include/linux/time.h --- 25/include/linux/time.h~do_setitimer-cleanup 2003-08-04 23:21:55.000000000 -0700 +++ 25-akpm/include/linux/time.h 2003-08-04 23:21:55.000000000 -0700 @@ -217,6 +217,9 @@ extern void clock_was_set(void); // call extern int do_posix_clock_monotonic_gettime(struct timespec *tp); extern long do_nanosleep(struct timespec *t); extern long do_utimes(char __user * filename, struct timeval * times); +struct itimerval; +extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); +extern int do_getitimer(int which, struct itimerval *value); static inline void set_normalized_timespec (struct timespec *ts, time_t sec, long nsec) diff -puN kernel/compat.c~do_setitimer-cleanup kernel/compat.c --- 25/kernel/compat.c~do_setitimer-cleanup 2003-08-04 23:21:55.000000000 -0700 +++ 25-akpm/kernel/compat.c 2003-08-04 23:21:55.000000000 -0700 @@ -116,8 +116,6 @@ static inline long put_compat_itimerval( __put_user(i->it_value.tv_usec, &o->it_value.tv_usec))); } -extern int do_getitimer(int which, struct itimerval *value); - asmlinkage long compat_sys_getitimer(int which, struct compat_itimerval *it) { struct itimerval kit; @@ -129,8 +127,6 @@ asmlinkage long compat_sys_getitimer(int return error; } -extern int do_setitimer(int which, struct itimerval *, struct itimerval *); - asmlinkage long compat_sys_setitimer(int which, struct compat_itimerval *in, struct compat_itimerval *out) { diff -puN kernel/itimer.c~do_setitimer-cleanup kernel/itimer.c --- 25/kernel/itimer.c~do_setitimer-cleanup 2003-08-04 23:21:55.000000000 -0700 +++ 25-akpm/kernel/itimer.c 2003-08-04 23:21:55.000000000 -0700 @@ -9,6 +9,7 @@ #include #include #include +#include #include diff -puN kernel/timer.c~do_setitimer-cleanup kernel/timer.c --- 25/kernel/timer.c~do_setitimer-cleanup 2003-08-04 23:21:55.000000000 -0700 +++ 25-akpm/kernel/timer.c 2003-08-04 23:21:55.000000000 -0700 @@ -829,8 +829,6 @@ void do_timer(struct pt_regs *regs) #if !defined(__alpha__) && !defined(__ia64__) -extern int do_setitimer(int, struct itimerval *, struct itimerval *); - /* * For backwards compatibility? This can be done in libc so Alpha * and all newer ports shouldn't need it. _