From 1a80521990a0e30e61a92994a009adc52161b070 Mon Sep 17 00:00:00 2001 From: Jeff Dike Date: Tue, 16 Oct 2007 01:27:28 -0700 Subject: uml: use *SEC_PER_*SEC constants There are various uses of powers of 1000, plus the odd BILLION constant in the time code. However, there are perfectly good definitions of *SEC_PER_*SEC in linux/time.h which can be used instaed. These are replaced directly in kernel code. Userspace code imports those constants as UM_*SEC_PER_*SEC and uses these. Signed-off-by: Jeff Dike Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/um/kernel/time.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'arch/um/kernel') diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index 2acdc7efb2ac..1ac746a9eae1 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c @@ -17,7 +17,7 @@ */ unsigned long long sched_clock(void) { - return (unsigned long long)jiffies_64 * (1000000000 / HZ); + return (unsigned long long)jiffies_64 * (NSEC_PER_SEC / HZ); } void timer_handler(int sig, struct uml_pt_regs *regs) @@ -118,8 +118,9 @@ void __init time_init(void) timer_init(); nsecs = os_nsecs(); - set_normalized_timespec(&wall_to_monotonic, -nsecs / BILLION, - -nsecs % BILLION); - set_normalized_timespec(&xtime, nsecs / BILLION, nsecs % BILLION); + set_normalized_timespec(&wall_to_monotonic, -nsecs / NSEC_PER_SEC, + -nsecs % NSEC_PER_SEC); + set_normalized_timespec(&xtime, nsecs / NSEC_PER_SEC, + nsecs % NSEC_PER_SEC); late_time_init = setup_itimer; } -- cgit v1.2.3