diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-10-16 04:27:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:08 -0400 |
commit | 1a80521990a0e30e61a92994a009adc52161b070 (patch) | |
tree | 3cf900adf9383ff68fd66cd74cfaf0e0ce483845 /arch/um/kernel | |
parent | 61b63c556c0877ee6d3832ee641bc427ff4d94d6 (diff) |
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 <jdike@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/kernel')
-rw-r--r-- | arch/um/kernel/time.c | 9 |
1 files changed, 5 insertions, 4 deletions
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 @@ | |||
17 | */ | 17 | */ |
18 | unsigned long long sched_clock(void) | 18 | unsigned long long sched_clock(void) |
19 | { | 19 | { |
20 | return (unsigned long long)jiffies_64 * (1000000000 / HZ); | 20 | return (unsigned long long)jiffies_64 * (NSEC_PER_SEC / HZ); |
21 | } | 21 | } |
22 | 22 | ||
23 | void timer_handler(int sig, struct uml_pt_regs *regs) | 23 | void timer_handler(int sig, struct uml_pt_regs *regs) |
@@ -118,8 +118,9 @@ void __init time_init(void) | |||
118 | timer_init(); | 118 | timer_init(); |
119 | 119 | ||
120 | nsecs = os_nsecs(); | 120 | nsecs = os_nsecs(); |
121 | set_normalized_timespec(&wall_to_monotonic, -nsecs / BILLION, | 121 | set_normalized_timespec(&wall_to_monotonic, -nsecs / NSEC_PER_SEC, |
122 | -nsecs % BILLION); | 122 | -nsecs % NSEC_PER_SEC); |
123 | set_normalized_timespec(&xtime, nsecs / BILLION, nsecs % BILLION); | 123 | set_normalized_timespec(&xtime, nsecs / NSEC_PER_SEC, |
124 | nsecs % NSEC_PER_SEC); | ||
124 | late_time_init = setup_itimer; | 125 | late_time_init = setup_itimer; |
125 | } | 126 | } |