From: Andrew Morton Date: Wed, 6 Feb 2008 09:38:06 +0000 (-0800) Subject: speed up jiffies conversion functions if HZ==USER_HZ X-Git-Tag: v2.6.25-rc1~664 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec03d7073971e20a866448d62c992a168201ac82;p=linux-2.6 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 --- diff --git a/kernel/time.c b/kernel/time.c index be5c8cb935..33af3e5557 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 /*