drivers/net/wireless: Use DIV_ROUND_CLOSEST
authorJulia Lawall <julia@diku.dk>
Sat, 1 Aug 2009 19:50:31 +0000 (21:50 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 4 Aug 2009 20:44:23 +0000 (16:44 -0400)
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@
@@

#include <linux/kernel.h>

@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: John W. Linville <linville@tuxdriver.com>

No differences found