diff options
author | Andreas Bombe <aeb@debian.org> | 2010-03-21 15:02:45 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:57:13 -0400 |
commit | dab7e3106ddd6cbc3b55301228407b9d17ce7773 (patch) | |
tree | 1b6caa87522844e7ea8cc01932365201271f1afd /drivers/media/video/omap24xxcam.c | |
parent | 0a062033f727dc041691bfd768f4cf0598f559a1 (diff) |
V4L/DVB: V4L2: Replace loops for finding max buffers in VIDIOC_REQBUFS callbacks
Due to obvious copy and paste coding a number of video capture drivers
which implement a limit on the buffer memory decremented the user
supplied buffer count in a while loop until it reaches an acceptable
value.
This is a silly thing to do when the maximum value can be directly
computed.
Signed-off-by: Andreas Bombe <aeb@debian.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/omap24xxcam.c')
-rw-r--r-- | drivers/media/video/omap24xxcam.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c index ce76d952e161..f85b2ed8a2d8 100644 --- a/drivers/media/video/omap24xxcam.c +++ b/drivers/media/video/omap24xxcam.c | |||
@@ -452,8 +452,8 @@ static int omap24xxcam_vbq_setup(struct videobuf_queue *vbq, unsigned int *cnt, | |||
452 | *size = fh->pix.sizeimage; | 452 | *size = fh->pix.sizeimage; |
453 | 453 | ||
454 | /* accessing fh->cam->capture_mem is ok, it's constant */ | 454 | /* accessing fh->cam->capture_mem is ok, it's constant */ |
455 | while (*size * *cnt > fh->cam->capture_mem) | 455 | if (*size * *cnt > fh->cam->capture_mem) |
456 | (*cnt)--; | 456 | *cnt = fh->cam->capture_mem / *size; |
457 | 457 | ||
458 | return 0; | 458 | return 0; |
459 | } | 459 | } |