aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2008-02-06 04:38:06 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 13:41:10 -0500
commitec03d7073971e20a866448d62c992a168201ac82 (patch)
tree16b1954017d97ff8a40ca4ee78fd8f837c710a14 /kernel/time.c
parent6ffc787a4492ac627315aaeafdfdc0a5c3028582 (diff)
speed up jiffies conversion functions if HZ==USER_HZ
Avoid calling do_div(x, 1) in this case. Cc: David Fries <david@fries.net> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@elte.hu> 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 'kernel/time.c')
-rw-r--r--kernel/time.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/time.c b/kernel/time.c
index be5c8cb93582..33af3e55570d 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -606,8 +606,10 @@ u64 jiffies_64_to_clock_t(u64 x)
606# if HZ < USER_HZ 606# if HZ < USER_HZ
607 x *= USER_HZ; 607 x *= USER_HZ;
608 do_div(x, HZ); 608 do_div(x, HZ);
609# else 609# elif HZ > USER_HZ
610 do_div(x, HZ / USER_HZ); 610 do_div(x, HZ / USER_HZ);
611# else
612 /* Nothing to do */
611# endif 613# endif
612#else 614#else
613 /* 615 /*