From ec03d7073971e20a866448d62c992a168201ac82 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 6 Feb 2008 01:38:06 -0800 Subject: [PATCH] speed up jiffies conversion functions if HZ==USER_HZ Avoid calling do_div(x, 1) in this case. Cc: David Fries Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/time.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) # if HZ < USER_HZ x *= USER_HZ; do_div(x, HZ); -# else +# elif HZ > USER_HZ do_div(x, HZ / USER_HZ); +# else + /* Nothing to do */ # endif #else /* -- 2.30.2