提交 ec03d707 编写于 作者: A Andrew Morton 提交者: Linus Torvalds

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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 6ffc787a
...@@ -606,8 +606,10 @@ u64 jiffies_64_to_clock_t(u64 x) ...@@ -606,8 +606,10 @@ u64 jiffies_64_to_clock_t(u64 x)
# if HZ < USER_HZ # if HZ < USER_HZ
x *= USER_HZ; x *= USER_HZ;
do_div(x, HZ); do_div(x, HZ);
# else # elif HZ > USER_HZ
do_div(x, HZ / USER_HZ); do_div(x, HZ / USER_HZ);
# else
/* Nothing to do */
# endif # endif
#else #else
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册