V4L/DVB (12483): Use DIV_ROUND_CLOSEST
authorJulia Lawall <julia@diku.dk>
Sat, 1 Aug 2009 19:48:41 +0000 (16:48 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 12 Sep 2009 15:19:08 +0000 (12:19 -0300)
commit75b697f747b14b0c6afae48ee0f5e605abd2df4c
tree3812e853ff3d8758cded2fdfebb58bdec76babfc
parent166987c6987a25a95cef6889d24088f0eb2daa36
V4L/DVB (12483): 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: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/dib7000p.c
drivers/media/dvb/frontends/stb6100.c
drivers/media/dvb/frontends/tda10021.c
drivers/media/dvb/frontends/ves1820.c
drivers/media/dvb/pluto2/pluto2.c
drivers/media/video/tuner-core.c
drivers/media/video/v4l1-compat.c