]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: drivers: Use DIV_ROUND_CLOSEST
authorTapasweni Pathak <tapaswenipathak@gmail.com>
Wed, 8 Oct 2014 17:43:47 +0000 (23:13 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Oct 2014 02:29:20 +0000 (10:29 +0800)
commit654909dbc1a090a0421d60263ed9c9ab2ad7d84a
tree211def2b4251c67ce39acabd3b66c9fed9484862
parentf42581b1f62d82f2f456f4680667fc4ad90a3580
staging: comedi: drivers: Use DIV_ROUND_CLOSEST

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

The Coccinelle script used:
// <smpl>
@haskernel@
@@
@depends on haskernel@
expression x,__divisor;
@@
- (((x) + ((__divisor) / 2)) / (__divisor))
+ DIV_ROUND_CLOSEST(x,__divisor)
// </smpl>

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/s626.c