diff options
-rw-r--r-- | drivers/media/video/bw-qcam.c | 4 | ||||
-rw-r--r-- | drivers/media/video/uvc/uvc_video.c | 2 | ||||
-rw-r--r-- | drivers/media/video/zoran_device.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c index 6e39e253ce53..01f07707827f 100644 --- a/drivers/media/video/bw-qcam.c +++ b/drivers/media/video/bw-qcam.c | |||
@@ -495,7 +495,7 @@ static void qc_set(struct qcam_device *q) | |||
495 | val2 = (((q->port_mode & QC_MODE_MASK) == QC_BIDIR) ? 24 : 8) * | 495 | val2 = (((q->port_mode & QC_MODE_MASK) == QC_BIDIR) ? 24 : 8) * |
496 | q->transfer_scale; | 496 | q->transfer_scale; |
497 | } | 497 | } |
498 | val = (val + val2 - 1) / val2; | 498 | val = DIV_ROUND_UP(val, val2); |
499 | qc_command(q, 0x13); | 499 | qc_command(q, 0x13); |
500 | qc_command(q, val); | 500 | qc_command(q, val); |
501 | 501 | ||
@@ -651,7 +651,7 @@ static long qc_capture(struct qcam_device * q, char __user *buf, unsigned long l | |||
651 | transperline = q->width * q->bpp; | 651 | transperline = q->width * q->bpp; |
652 | divisor = (((q->port_mode & QC_MODE_MASK) == QC_BIDIR) ? 24 : 8) * | 652 | divisor = (((q->port_mode & QC_MODE_MASK) == QC_BIDIR) ? 24 : 8) * |
653 | q->transfer_scale; | 653 | q->transfer_scale; |
654 | transperline = (transperline + divisor - 1) / divisor; | 654 | transperline = DIV_ROUND_UP(transperline, divisor); |
655 | 655 | ||
656 | for (i = 0, yield = yieldlines; i < linestotrans; i++) | 656 | for (i = 0, yield = yieldlines; i < linestotrans; i++) |
657 | { | 657 | { |
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c index 6854ac78a161..03dc3a519e4c 100644 --- a/drivers/media/video/uvc/uvc_video.c +++ b/drivers/media/video/uvc/uvc_video.c | |||
@@ -655,7 +655,7 @@ static int uvc_init_video_isoc(struct uvc_video_device *video, | |||
655 | if (size > UVC_MAX_FRAME_SIZE) | 655 | if (size > UVC_MAX_FRAME_SIZE) |
656 | return -EINVAL; | 656 | return -EINVAL; |
657 | 657 | ||
658 | npackets = (size + psize - 1) / psize; | 658 | npackets = DIV_ROUND_UP(size, psize); |
659 | if (npackets > UVC_MAX_ISO_PACKETS) | 659 | if (npackets > UVC_MAX_ISO_PACKETS) |
660 | npackets = UVC_MAX_ISO_PACKETS; | 660 | npackets = UVC_MAX_ISO_PACKETS; |
661 | 661 | ||
diff --git a/drivers/media/video/zoran_device.c b/drivers/media/video/zoran_device.c index 88d369708e4c..2b3ca1493373 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, | |||
377 | 377 | ||
378 | /* horizontal */ | 378 | /* horizontal */ |
379 | VidWinWid = video_width; | 379 | VidWinWid = video_width; |
380 | X = (VidWinWid * 64 + tvn->Wa - 1) / tvn->Wa; | 380 | X = DIV_ROUND_UP(VidWinWid * 64, tvn->Wa); |
381 | We = (VidWinWid * 64) / X; | 381 | We = (VidWinWid * 64) / X; |
382 | HorDcm = 64 - X; | 382 | HorDcm = 64 - X; |
383 | hcrop1 = 2 * ((tvn->Wa - We) / 4); | 383 | hcrop1 = 2 * ((tvn->Wa - We) / 4); |
@@ -403,7 +403,7 @@ zr36057_set_vfe (struct zoran *zr, | |||
403 | /* Vertical */ | 403 | /* Vertical */ |
404 | DispMode = !(video_height > BUZ_MAX_HEIGHT / 2); | 404 | DispMode = !(video_height > BUZ_MAX_HEIGHT / 2); |
405 | VidWinHt = DispMode ? video_height : video_height / 2; | 405 | VidWinHt = DispMode ? video_height : video_height / 2; |
406 | Y = (VidWinHt * 64 * 2 + tvn->Ha - 1) / tvn->Ha; | 406 | Y = DIV_ROUND_UP(VidWinHt * 64 * 2, tvn->Ha); |
407 | He = (VidWinHt * 64) / Y; | 407 | He = (VidWinHt * 64) / Y; |
408 | VerDcm = 64 - Y; | 408 | VerDcm = 64 - Y; |
409 | vcrop1 = (tvn->Ha / 2 - He) / 2; | 409 | vcrop1 = (tvn->Ha / 2 - He) / 2; |