- Coding style - Make register_posix_clock static. Signed-off-by: Andrew Morton --- 25-akpm/include/linux/posix-timers.h | 4 --- 25-akpm/include/linux/sched.h | 2 - 25-akpm/include/linux/time.h | 1 25-akpm/kernel/posix-timers.c | 45 +++++++++++++++++++++-------------- 4 files changed, 29 insertions(+), 23 deletions(-) diff -puN include/linux/posix-timers.h~posix-compliant-cpu-clocks-v6-generic-kernel-patch-tidy include/linux/posix-timers.h --- 25/include/linux/posix-timers.h~posix-compliant-cpu-clocks-v6-generic-kernel-patch-tidy 2004-10-01 17:59:11.747913208 -0700 +++ 25-akpm/include/linux/posix-timers.h 2004-10-01 18:32:17.194079512 -0700 @@ -45,14 +45,12 @@ struct k_clock { struct itimerspec * cur_setting); }; -void register_posix_clock(int clock_id, struct k_clock *new_clock); - /* Error handlers for timer_create and nanosleep */ int do_posix_clock_notimer_create(int which_clock, struct sigevent __user *time_event_spec, timer_t __user *created_timer_id); -int do_posix_clock_nonanosleep(int which_clock, int flags, struct timespec * t); +int do_posix_clock_nonanosleep(int which_clock, int flags, struct timespec *t); struct now_struct { unsigned long jiffies; diff -puN include/linux/sched.h~posix-compliant-cpu-clocks-v6-generic-kernel-patch-tidy include/linux/sched.h --- 25/include/linux/sched.h~posix-compliant-cpu-clocks-v6-generic-kernel-patch-tidy 2004-10-01 17:59:11.749912904 -0700 +++ 25-akpm/include/linux/sched.h 2004-10-01 17:59:11.756911840 -0700 @@ -293,7 +293,7 @@ struct signal_struct { /* POSIX.1b Interval Timers */ struct list_head posix_timers; - int process_clock_offset; /* for CLOCK_PROCESS_CPUTIME_ID */ + int process_clock_offset; /* for CLOCK_PROCESS_CPUTIME_ID */ /* job control IDs */ pid_t pgrp; diff -puN include/linux/time.h~posix-compliant-cpu-clocks-v6-generic-kernel-patch-tidy include/linux/time.h --- 25/include/linux/time.h~posix-compliant-cpu-clocks-v6-generic-kernel-patch-tidy 2004-10-01 17:59:11.750912752 -0700 +++ 25-akpm/include/linux/time.h 2004-10-01 18:32:04.032080440 -0700 @@ -161,7 +161,6 @@ struct itimerval { * The IDs of various hardware clocks */ - #define MAX_CLOCKS 16 #define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC | \ CLOCK_REALTIME_HR | CLOCK_MONOTONIC_HR) diff -puN kernel/posix-timers.c~posix-compliant-cpu-clocks-v6-generic-kernel-patch-tidy kernel/posix-timers.c --- 25/kernel/posix-timers.c~posix-compliant-cpu-clocks-v6-generic-kernel-patch-tidy 2004-10-01 17:59:11.752912448 -0700 +++ 25-akpm/kernel/posix-timers.c 2004-10-01 17:59:11.758911536 -0700 @@ -189,7 +189,7 @@ static struct k_clock_abs abs_list = {.l #define p_timer_del(clock,a) \ if_clock_do((clock)->timer_del, do_timer_delete, (a)) -void register_posix_clock(int clock_id, struct k_clock *new_clock); +static void register_posix_clock(int clock_id, struct k_clock *new_clock); static int do_posix_gettime(struct k_clock *clock, struct timespec *tp); static u64 do_posix_clock_monotonic_gettime_parts( struct timespec *tp, struct timespec *mo); @@ -200,10 +200,6 @@ static int do_posix_clock_process_settim static int do_posix_clock_thread_gettime(struct timespec *tp); static int do_posix_clock_thread_settime(struct timespec *tp); static struct k_itimer *lock_timer(timer_t timer_id, unsigned long *flags); -int do_posix_clock_notimer_create(int which_clock, - struct sigevent __user *time_event_spec, - timer_t __user *created_timer_id); -int do_posix_clock_nonanosleep(int which_clock, int flags, struct timespec * t); static inline void unlock_timer(struct k_itimer *timr, unsigned long flags) { @@ -215,22 +211,26 @@ static inline void unlock_timer(struct k */ static __init int init_posix_timers(void) { - struct k_clock clock_realtime = {.res = CLOCK_REALTIME_RES, - .abs_struct = &abs_list + struct k_clock clock_realtime = { + .res = CLOCK_REALTIME_RES, + .abs_struct = &abs_list }; - struct k_clock clock_monotonic = {.res = CLOCK_REALTIME_RES, + struct k_clock clock_monotonic = { + .res = CLOCK_REALTIME_RES, .abs_struct = NULL, .clock_get = do_posix_clock_monotonic_gettime, .clock_set = do_posix_clock_monotonic_settime }; - struct k_clock clock_thread = {.res = CLOCK_REALTIME_RES, + struct k_clock clock_thread = { + .res = CLOCK_REALTIME_RES, .abs_struct = NULL, .clock_get = do_posix_clock_thread_gettime, .clock_set = do_posix_clock_thread_settime, .timer_create = do_posix_clock_notimer_create, .nsleep = do_posix_clock_nonanosleep }; - struct k_clock clock_process = {.res = CLOCK_REALTIME_RES, + struct k_clock clock_process = { + .res = CLOCK_REALTIME_RES, .abs_struct = NULL, .clock_get = do_posix_clock_process_gettime, .clock_set = do_posix_clock_process_settime, @@ -537,7 +537,7 @@ static inline struct task_struct * good_ return rtn; } -void register_posix_clock(int clock_id, struct k_clock *new_clock) +static void register_posix_clock(int clock_id, struct k_clock *new_clock) { if ((unsigned) clock_id >= MAX_CLOCKS) { printk("POSIX clock register failed for clock_id %d\n", @@ -1254,12 +1254,16 @@ static int do_posix_clock_monotonic_sett int do_posix_clock_notimer_create(int which_clock, struct sigevent __user *timer_event_spec, - timer_t __user *created_timer_id) { + timer_t __user *created_timer_id) +{ return -EINVAL; } -int do_posix_clock_nonanosleep(int which_lock, int flags,struct timespec * t) { -/* Single Unix specficiation says to return ENOTSUP but we do not have that */ +/* + * Single Unix specficiation says to return ENOTSUP but we do not have that + */ +int do_posix_clock_nonanosleep(int which_lock, int flags, struct timespec *t) +{ return -EINVAL; } @@ -1283,7 +1287,7 @@ static int do_posix_clock_thread_gettime static int do_posix_clock_thread_settime(struct timespec *tp) { current->thread_clock_offset = timespec_to_jiffies(tp) - - current->utime - current->stime; + - current->utime - current->stime; return 0; } @@ -1306,7 +1310,10 @@ static unsigned long process_ticks(void) /* The signal structure is shared between all threads */ ticks = current->signal->utime + current->signal->stime; - /* Add up the cpu time for all the still running threads of this process */ + /* + * Add up the cpu time for all the still running threads of this + * process + */ t = current; do { ticks += t->utime + t->stime; @@ -1319,13 +1326,15 @@ static unsigned long process_ticks(void) static int do_posix_clock_process_gettime(struct timespec *tp) { - jiffies_to_timespec(current->signal->process_clock_offset + process_ticks(), tp); + jiffies_to_timespec(current->signal->process_clock_offset + + process_ticks(), tp); return 0; } static int do_posix_clock_process_settime(struct timespec *tp) { - current->signal->process_clock_offset = timespec_to_jiffies(tp) - process_ticks(); + current->signal->process_clock_offset = timespec_to_jiffies(tp) - + process_ticks(); return 0; } _