aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@kernellabs.com>2009-09-14 23:18:06 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-18 23:14:05 -0400
commite3ba4d34d031985366f7ea06395fa9772ff77ce6 (patch)
tree0370e60d40ad4428451a10a90910e78ad7171a12
parentcb0409ffb7fa83a9ab561fe7e551ba8f817ca148 (diff)
V4L/DVB (12881): em28xx: fix codingstyle issues in em28xx-video.c
Fix some codingstyle issues introduced during the addition of em28xx VBI support. The patch makes no functional changes other than converting a few debug printk() statements to em28xx_isocdbg. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 2466c0faf3c7..3a1dfb7726f8 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -256,7 +256,8 @@ static void em28xx_copy_video(struct em28xx *dev,
256 256
257 if ((char *)startwrite + lencopy > (char *)outp + 257 if ((char *)startwrite + lencopy > (char *)outp +
258 buf->vb.size) { 258 buf->vb.size) {
259 em28xx_isocdbg("Overflow of %zi bytes past buffer end (2)\n", 259 em28xx_isocdbg("Overflow of %zi bytes past buffer end"
260 "(2)\n",
260 ((char *)startwrite + lencopy) - 261 ((char *)startwrite + lencopy) -
261 ((char *)outp + buf->vb.size)); 262 ((char *)outp + buf->vb.size));
262 lencopy = remain = (char *)outp + buf->vb.size - 263 lencopy = remain = (char *)outp + buf->vb.size -
@@ -284,23 +285,23 @@ static void em28xx_copy_vbi(struct em28xx *dev,
284 int bytesperline = 720; 285 int bytesperline = 720;
285 286
286 if (dev == NULL) { 287 if (dev == NULL) {
287 printk("dev is null\n"); 288 em28xx_isocdbg("dev is null\n");
288 return; 289 return;
289 } 290 }
290 291
291 if (dma_q == NULL) { 292 if (dma_q == NULL) {
292 printk("dma_q is null\n"); 293 em28xx_isocdbg("dma_q is null\n");
293 return; 294 return;
294 } 295 }
295 if (buf == NULL) { 296 if (buf == NULL) {
296 return; 297 return;
297 } 298 }
298 if (p == NULL) { 299 if (p == NULL) {
299 printk("p is null\n"); 300 em28xx_isocdbg("p is null\n");
300 return; 301 return;
301 } 302 }
302 if (outp == NULL) { 303 if (outp == NULL) {
303 printk("outp is null\n"); 304 em28xx_isocdbg("outp is null\n");
304 return; 305 return;
305 } 306 }
306 307
@@ -584,7 +585,7 @@ static inline int em28xx_isoc_copy_vbi(struct em28xx *dev, struct urb *urb)
584 if (dev->vbi_read >= vbi_size) { 585 if (dev->vbi_read >= vbi_size) {
585 /* We've already read all the VBI data, so 586 /* We've already read all the VBI data, so
586 treat the rest as video */ 587 treat the rest as video */
587 printk("djh c should never happen\n"); 588 em28xx_isocdbg("dev->vbi_read > vbi_size\n");
588 } else if ((dev->vbi_read + len) < vbi_size) { 589 } else if ((dev->vbi_read + len) < vbi_size) {
589 /* This entire frame is VBI data */ 590 /* This entire frame is VBI data */
590 if (dev->vbi_read == 0 && 591 if (dev->vbi_read == 0 &&
@@ -597,9 +598,9 @@ static inline int em28xx_isoc_copy_vbi(struct em28xx *dev, struct urb *urb)
597 vbi_get_next_buf(vbi_dma_q, &vbi_buf); 598 vbi_get_next_buf(vbi_dma_q, &vbi_buf);
598 if (vbi_buf == NULL) 599 if (vbi_buf == NULL)
599 vbioutp = NULL; 600 vbioutp = NULL;
600 else { 601 else
601 vbioutp = videobuf_to_vmalloc(&vbi_buf->vb); 602 vbioutp = videobuf_to_vmalloc(
602 } 603 &vbi_buf->vb);
603 } 604 }
604 605
605 if (dev->vbi_read == 0) { 606 if (dev->vbi_read == 0) {
@@ -669,7 +670,8 @@ buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size)
669 struct em28xx *dev = fh->dev; 670 struct em28xx *dev = fh->dev;
670 struct v4l2_frequency f; 671 struct v4l2_frequency f;
671 672
672 *size = (fh->dev->width * fh->dev->height * dev->format->depth + 7) >> 3; 673 *size = (fh->dev->width * fh->dev->height * dev->format->depth + 7)
674 >> 3;
673 675
674 if (0 == *count) 676 if (0 == *count)
675 *count = EM28XX_DEF_BUF; 677 *count = EM28XX_DEF_BUF;
@@ -723,7 +725,8 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
723 struct em28xx *dev = fh->dev; 725 struct em28xx *dev = fh->dev;
724 int rc = 0, urb_init = 0; 726 int rc = 0, urb_init = 0;
725 727
726 buf->vb.size = (fh->dev->width * fh->dev->height * dev->format->depth + 7) >> 3; 728 buf->vb.size = (fh->dev->width * fh->dev->height * dev->format->depth
729 + 7) >> 3;
727 730
728 if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size) 731 if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size)
729 return -EINVAL; 732 return -EINVAL;
@@ -858,12 +861,12 @@ static int res_get(struct em28xx_fh *fh, unsigned int bit)
858 861
859static int res_check(struct em28xx_fh *fh, unsigned int bit) 862static int res_check(struct em28xx_fh *fh, unsigned int bit)
860{ 863{
861 return (fh->resources & bit); 864 return fh->resources & bit;
862} 865}
863 866
864static int res_locked(struct em28xx *dev, unsigned int bit) 867static int res_locked(struct em28xx *dev, unsigned int bit)
865{ 868{
866 return (dev->resources & bit); 869 return dev->resources & bit;
867} 870}
868 871
869static void res_free(struct em28xx_fh *fh, unsigned int bits) 872static void res_free(struct em28xx_fh *fh, unsigned int bits)
@@ -1066,7 +1069,8 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
1066 } else { 1069 } else {
1067 /* width must even because of the YUYV format 1070 /* width must even because of the YUYV format
1068 height must be even because of interlacing */ 1071 height must be even because of interlacing */
1069 v4l_bound_align_image(&width, 48, maxw, 1, &height, 32, maxh, 1, 0); 1072 v4l_bound_align_image(&width, 48, maxw, 1, &height, 32, maxh,
1073 1, 0);
1070 } 1074 }
1071 1075
1072 get_scale(dev, width, height, &hscale, &vscale); 1076 get_scale(dev, width, height, &hscale, &vscale);
@@ -1718,7 +1722,7 @@ static int vidioc_streamon(struct file *file, void *priv,
1718 em28xx_videodbg("vidioc_streamon fh=%p t=%d fh->res=%d dev->res=%d\n", 1722 em28xx_videodbg("vidioc_streamon fh=%p t=%d fh->res=%d dev->res=%d\n",
1719 fh, type, fh->resources, dev->resources); 1723 fh, type, fh->resources, dev->resources);
1720 1724
1721 if (unlikely(!res_get(fh,get_ressource(fh)))) 1725 if (unlikely(!res_get(fh, get_ressource(fh))))
1722 return -EBUSY; 1726 return -EBUSY;
1723 1727
1724 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) 1728 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
@@ -1941,9 +1945,8 @@ static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b)
1941 1945
1942 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) 1946 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
1943 return videobuf_qbuf(&fh->vb_vidq, b); 1947 return videobuf_qbuf(&fh->vb_vidq, b);
1944 else { 1948 else
1945 return videobuf_qbuf(&fh->vb_vbiq, b); 1949 return videobuf_qbuf(&fh->vb_vbiq, b);
1946 }
1947} 1950}
1948 1951
1949static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b) 1952static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b)
@@ -2212,7 +2215,7 @@ static int em28xx_v4l2_close(struct file *filp)
2212 res_free(fh, EM28XX_RESOURCE_VBI); 2215 res_free(fh, EM28XX_RESOURCE_VBI);
2213 } 2216 }
2214 2217
2215 if(dev->users == 1) { 2218 if (dev->users == 1) {
2216 /* the device is already disconnect, 2219 /* the device is already disconnect,
2217 free the remaining resources */ 2220 free the remaining resources */
2218 if (dev->state & DEV_DISCONNECTED) { 2221 if (dev->state & DEV_DISCONNECTED) {