aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-video.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-13 13:56:25 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:08:47 -0400
commit78bb3949a965e8a28e20988e28868429606b3639 (patch)
tree5cdf627e63645b35bf167da6cf376afb60113d06 /drivers/media/video/em28xx/em28xx-video.c
parente0fadfd34dda2205b296b8826acfaaf4df2e022f (diff)
V4L/DVB (7549): em28xx: some small cleanups
- Remove dead code; - Fix a few CodingStyle issues; - Prints frame number, if debug is enabled. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index e2d04cf4ba9d..0a2ff4afe416 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -133,7 +133,7 @@ static inline void buffer_filled(struct em28xx *dev,
133 struct em28xx_dmaqueue *dma_q, 133 struct em28xx_dmaqueue *dma_q,
134 struct em28xx_buffer *buf) 134 struct em28xx_buffer *buf)
135{ 135{
136 mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT); 136 mod_timer(&dma_q->timeout, jiffies + BUFFER_TIMEOUT);
137 137
138 /* Advice that buffer was filled */ 138 /* Advice that buffer was filled */
139 em28xx_isocdbg("[%p/%d] wakeup\n", buf, buf->vb.i); 139 em28xx_isocdbg("[%p/%d] wakeup\n", buf, buf->vb.i);
@@ -159,7 +159,7 @@ static void em28xx_copy_video(struct em28xx *dev,
159 159
160 if (dev->frame_size != buf->vb.size) { 160 if (dev->frame_size != buf->vb.size) {
161 em28xx_errdev("size %i and buf.length %lu are different!\n", 161 em28xx_errdev("size %i and buf.length %lu are different!\n",
162 dev->frame_size, buf->vb.size); 162 dev->frame_size, buf->vb.size);
163 return; 163 return;
164 } 164 }
165 165
@@ -208,8 +208,6 @@ static void em28xx_copy_video(struct em28xx *dev,
208 else 208 else
209 lencopy = dev->bytesperline; 209 lencopy = dev->bytesperline;
210 210
211 BUG_ON(lencopy <= 0);
212
213 if ((char *)startwrite + lencopy > (char *)outp + buf->vb.size) { 211 if ((char *)startwrite + lencopy > (char *)outp + buf->vb.size) {
214 em28xx_isocdbg("Overflow of %zi bytes past buffer end (2)\n", 212 em28xx_isocdbg("Overflow of %zi bytes past buffer end (2)\n",
215 ((char *)startwrite + lencopy) - 213 ((char *)startwrite + lencopy) -
@@ -319,7 +317,6 @@ static inline int em28xx_isoc_copy(struct urb *urb)
319 317
320 outp = videobuf_to_vmalloc(&buf->vb); 318 outp = videobuf_to_vmalloc(&buf->vb);
321 319
322
323 for (i = 0; i < urb->number_of_packets; i++) { 320 for (i = 0; i < urb->number_of_packets; i++) {
324 int status = urb->iso_frame_desc[i].status; 321 int status = urb->iso_frame_desc[i].status;
325 322
@@ -347,11 +344,8 @@ static inline int em28xx_isoc_copy(struct urb *urb)
347 logic simpler. Impacts of those changes should be evaluated 344 logic simpler. Impacts of those changes should be evaluated
348 */ 345 */
349 if (p[0] == 0x22 && p[1] == 0x5a) { 346 if (p[0] == 0x22 && p[1] == 0x5a) {
350 /* FIXME - are the fields the right way around? */ 347 em28xx_isocdbg("Video frame %d, length=%i, %s\n", p[2],
351 em28xx_isocdbg("Video frame, length=%i, %s\n", len, 348 len, (p[2] & 1)? "odd" : "even");
352 (p[2] & 1)? "odd" : "even");
353 em28xx_isocdbg("Current buffer is: outp = 0x%p,"
354 " len = %i\n", outp, (int)buf->vb.size);
355 349
356 if (p[2] & 1) 350 if (p[2] & 1)
357 buf->top_field = 0; 351 buf->top_field = 0;
@@ -455,7 +449,6 @@ static void em28xx_uninit_isoc(struct em28xx *dev)
455 em28xx_capture_start(dev, 0); 449 em28xx_capture_start(dev, 0);
456} 450}
457 451
458
459/* 452/*
460 * Allocate URBs and start IRQ 453 * Allocate URBs and start IRQ
461 */ 454 */