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-Url: https://git.stricted.de/?a=commitdiff_plain;h=ec03d7073971e20a866448d62c992a168201ac82;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 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 /*