diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-08-01 19:48:41 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-08-01 19:48:41 +0000 |
commit | 3a5d86fcd1ef7eb3617d26046cdffea4245ca987 (patch) | |
tree | 57af7a49484f29e5fa9aee1bba82b6c5a1924932 /linux/drivers/media/dvb/pluto2/pluto2.c | |
parent | 2cf40a2b22144d35374eec8c26aab124bc129818 (diff) | |
download | mediapointer-dvb-s2-3a5d86fcd1ef7eb3617d26046cdffea4245ca987.tar.gz mediapointer-dvb-s2-3a5d86fcd1ef7eb3617d26046cdffea4245ca987.tar.bz2 |
Use DIV_ROUND_CLOSEST
From: Julia Lawall <julia@diku.dk>
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 'linux/drivers/media/dvb/pluto2/pluto2.c')
-rw-r--r-- | linux/drivers/media/dvb/pluto2/pluto2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/pluto2/pluto2.c b/linux/drivers/media/dvb/pluto2/pluto2.c index 647f6290e..8b6b2c094 100644 --- a/linux/drivers/media/dvb/pluto2/pluto2.c +++ b/linux/drivers/media/dvb/pluto2/pluto2.c @@ -447,7 +447,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) */ |