arch/m32r: Use DIV_ROUND_CLOSEST
authorJulia Lawall <julia@diku.dk>
Sun, 2 Aug 2009 08:47:27 +0000 (10:47 +0200)
committerHirokazu Takata <takata@linux-m32r.org>
Tue, 3 Nov 2009 23:31:50 +0000 (08:31 +0900)
commit560235857fb79da48d36e8f866a0ee3b10a232bf
tree5635f5ec3fca87f35caf0ef0bff7fdbc21782ff1
parentb419148e567728f6af0c3b01965c1cc141e3e13a
arch/m32r: Use DIV_ROUND_CLOSEST

The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d
but is perhaps more readable.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@haskernel@
@@

@depends on haskernel@
expression x,__divisor;
@@

- (((x) + ((__divisor) / 2)) / (__divisor))
+ DIV_ROUND_CLOSEST(x,__divisor)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
arch/m32r/kernel/time.c