aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/pluto2
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2009-08-01 16:48:41 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-12 12:19:08 -0300
commit75b697f747b14b0c6afae48ee0f5e605abd2df4c (patch)
tree3812e853ff3d8758cded2fdfebb58bdec76babfc /drivers/media/dvb/pluto2
parentV4L/DVB (12482): firedtv: add PID filtering for SW zigzag retune (diff)
downloadlinux-dev-75b697f747b14b0c6afae48ee0f5e605abd2df4c.tar.xz
linux-dev-75b697f747b14b0c6afae48ee0f5e605abd2df4c.zip
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>
Diffstat (limited to 'drivers/media/dvb/pluto2')
-rw-r--r--drivers/media/dvb/pluto2/pluto2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/dvb/pluto2/pluto2.c b/drivers/media/dvb/pluto2/pluto2.c
index 598eaf8acc6e..80d14a065bad 100644
--- a/drivers/media/dvb/pluto2/pluto2.c
+++ b/drivers/media/dvb/pluto2/pluto2.c
@@ -439,7 +439,7 @@ static inline u32 divide(u32 numerator, u32 denominator)
if (denominator == 0)
return ~0;
- return (numerator + denominator / 2) / denominator;
+ return DIV_ROUND_CLOSEST(numerator, denominator);
}
/* LG Innotek TDTE-E001P (Infineon TUA6034) */