]> git.baikalelectronics.ru Git - kernel.git/commit
tile: avoid overflow in ns2cycles
authorHenrik Austad <henrik@austad.us>
Tue, 4 Mar 2014 08:20:53 +0000 (09:20 +0100)
committerChris Metcalf <cmetcalf@tilera.com>
Thu, 6 Mar 2014 16:53:12 +0000 (11:53 -0500)
commit9dba2eef53404175abf42e80f563dd40545a3b3e
tree83d5b3ea8f10688b80262172dda68e23b68816ff
parentfb7af1b2925915b0cb577ee717ef0b72ec54a3d6
tile: avoid overflow in ns2cycles

In commit 346196bb64c ("sched, x86: Avoid unnecessary overflow in
sched_clock") and in recent patch "clocksource: avoid unnecessary
overflow in cyclecounter_cyc2ns()" https://lkml.org/lkml/2014/3/4/17,
the mult-shift approach is replaced by 2 steps to avoid storing a large,
intermediate value that could overflow.

arch/tile/kernel/time.c has a similar pattern in cycles2ns, and this
copies the same pattern in this function

CC: John Stultz <johnstul@us.ibm.com>
CC: Mike Galbraith <bitbucket@online.de>
CC: Salman Qazi <sqazi@google.com>
Signed-off-by: Henrik Austad <henrik@austad.us>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
arch/tile/kernel/time.c