From: Nicolas Pitre Date: Wed, 3 Dec 2014 19:43:06 +0000 (-0500) Subject: ktime: Optimize ktime_divns for constant divisors X-Git-Tag: omap-for-v4.1/prcm-dts-mfd-syscon-fix~162^2~1^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b618628b2bf83512fc8df5e8672619d65adfdfb;p=pandora-kernel.git ktime: Optimize ktime_divns for constant divisors At least on ARM, do_div() is optimized to turn constant divisors into an inline multiplication by the reciprocal value at compile time. However this optimization is missed entirely whenever ktime_divns() is used and the slow out-of-line division code is used all the time. Let ktime_divns() use do_div() inline whenever the divisor is constant and small enough. This will make things like ktime_to_us() and ktime_to_ms() much faster. Cc: Arnd Bergmann Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Nicolas Pitre Acked-by: Arnd Bergmann Signed-off-by: Nicolas Pitre Signed-off-by: John Stultz --- Reading git-diff-tree failed