summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/zoran_device.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2008-08-20 20:44:53 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 09:36:51 -0200
commite9e24cee67bf71b929b646387f286e907cbde5fc (patch)
treefd3be5482d9a17cd5df69ca8e0cd0ba5c0d4cb5c /drivers/media/video/zoran_device.c
parent95908ece60443ceb188fccf021d62823de8e6f0c (diff)
V4L/DVB (8729): Use DIV_ROUND_UP
The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @haskernel@ @@ @depends on haskernel@ expression n,d; @@ ( - (n + d - 1) / d + DIV_ROUND_UP(n,d) | - (n + (d - 1)) / d + DIV_ROUND_UP(n,d) ) @depends on haskernel@ expression n,d; @@ - DIV_ROUND_UP((n),d) + DIV_ROUND_UP(n,d) @depends on haskernel@ expression n,d; @@ - DIV_ROUND_UP(n,(d)) + DIV_ROUND_UP(n,d) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/zoran_device.c')
-rw-r--r--drivers/media/video/zoran_device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/zoran_device.c b/drivers/media/video/zoran_device.c
index 88d369708e4..2b3ca149337 100644
--- a/drivers/media/video/zoran_device.c
+++ b/drivers/media/video/zoran_device.c
@@ -377,7 +377,7 @@ zr36057_set_vfe (struct zoran *zr,
/* horizontal */
VidWinWid = video_width;
- X = (VidWinWid * 64 + tvn->Wa - 1) / tvn->Wa;
+ X = DIV_ROUND_UP(VidWinWid * 64, tvn->Wa);
We = (VidWinWid * 64) / X;
HorDcm = 64 - X;
hcrop1 = 2 * ((tvn->Wa - We) / 4);
@@ -403,7 +403,7 @@ zr36057_set_vfe (struct zoran *zr,
/* Vertical */
DispMode = !(video_height > BUZ_MAX_HEIGHT / 2);
VidWinHt = DispMode ? video_height : video_height / 2;
- Y = (VidWinHt * 64 * 2 + tvn->Ha - 1) / tvn->Ha;
+ Y = DIV_ROUND_UP(VidWinHt * 64 * 2, tvn->Ha);
He = (VidWinHt * 64) / Y;
VerDcm = 64 - Y;
vcrop1 = (tvn->Ha / 2 - He) / 2;