V4L/DVB (7545): em28xx: Fix CodingStyle errors and most warnings introduced by videobuf

The last videobuf changes introduced several CodingStyle errors. Fixes all those
errors, as reported by checkpatch.pl

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
Mauro Carvalho Chehab
2008-04-13 14:41:23 -03:00
parent ca21d2dc94
commit f245e549f0

View File

@@ -61,7 +61,7 @@ MODULE_PARM_DESC(isoc_debug,"enable debug messages [isoc transfers]");
#define em28xx_isocdbg(fmt, arg...) do {\
if (isoc_debug) \
printk(KERN_INFO "%s %s :"fmt, \
dev->name, __FUNCTION__ , ##arg); } while (0)
dev->name, __func__ , ##arg); } while (0)
#define BUFFER_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
@@ -129,7 +129,7 @@ static struct usb_driver em28xx_usb_driver;
/*
* Announces that a buffer were filled and request the next
*/
static void inline buffer_filled (struct em28xx *dev,
static inline void buffer_filled(struct em28xx *dev,
struct em28xx_dmaqueue *dma_q,
struct em28xx_buffer *buf)
{
@@ -198,7 +198,8 @@ static void em28xx_copy_video(struct em28xx *dev,
if ((char *)startwrite + lencopy > (char *)outp + buf->vb.size) {
em28xx_isocdbg("Overflow of %zi bytes past buffer end (1)\n",
((char*)startwrite + lencopy) - ((char*)outp + buf->vb.size));
((char *)startwrite + lencopy) -
((char *)outp + buf->vb.size));
lencopy = remain = (char *)outp + buf->vb.size - (char *)startwrite;
}
BUG_ON(lencopy <= 0);
@@ -218,10 +219,13 @@ static void em28xx_copy_video(struct em28xx *dev,
if ((char *)startwrite + lencopy > (char *)outp + buf->vb.size) {
em28xx_isocdbg("Overflow of %zi bytes past buffer end (2)\n",
((char*)startwrite + lencopy) - ((char*)outp + buf->vb.size));
lencopy = remain = (char*)outp + buf->vb.size - (char*)startwrite;
((char *)startwrite + lencopy) -
((char *)outp + buf->vb.size));
lencopy = remain = (char *)outp + buf->vb.size -
(char *)startwrite;
}
if(lencopy <= 0) break;
if (lencopy <= 0)
break;
memcpy(startwrite, startread, lencopy);
@@ -231,7 +235,7 @@ static void em28xx_copy_video(struct em28xx *dev,
dma_q->pos += len;
}
static void inline print_err_status (struct em28xx *dev,
static inline void print_err_status(struct em28xx *dev,
int packet, int status)
{
char *errmsg = "Unknown";
@@ -273,7 +277,7 @@ static void inline print_err_status (struct em28xx *dev,
/*
* video-buf generic routine to get the next available buffer
*/
static int inline get_next_buf (struct em28xx_dmaqueue *dma_q,
static inline int get_next_buf(struct em28xx_dmaqueue *dma_q,
struct em28xx_buffer **buf)
{
struct em28xx *dev = container_of(dma_q, struct em28xx, vidq);
@@ -353,7 +357,8 @@ static inline int em28xx_isoc_copy(struct urb *urb)
/* FIXME - are the fields the right way around? */
em28xx_isocdbg("Video frame, length=%i, %s\n", len,
(p[2] & 1)? "top" : "bottom");
em28xx_isocdbg("Current buffer is: outp = 0x%p, len = %i\n", outp, (int)buf->vb.size);
em28xx_isocdbg("Current buffer is: outp = 0x%p,"
" len = %i\n", outp, (int)buf->vb.size);
if (p[2] & 1) {
if (buf->receiving) {
@@ -366,9 +371,8 @@ static inline int em28xx_isoc_copy(struct urb *urb)
}
buf->top_field = 1;
} else {
} else
buf->top_field = 0;
}
buf->receiving = 1;
dma_q->pos = 0;
} else if (p[0] == 0x33 && p[1] == 0x95 && p[2] == 0x00) {
@@ -408,7 +412,8 @@ static void em28xx_irq_callback(struct urb *urb)
}
urb->status = 0;
if ((urb->status = usb_submit_urb(urb, GFP_ATOMIC))) {
urb->status = usb_submit_urb(urb, GFP_ATOMIC);
if (urb->status) {
em28xx_err("urb resubmit failed (error=%i)\n",
urb->status);
}
@@ -603,9 +608,8 @@ buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size)
if (0 == *count)
*count = EM28XX_DEF_BUF;
if (*count < EM28XX_MIN_BUF) {
if (*count < EM28XX_MIN_BUF)
*count = EM28XX_MIN_BUF;
}
return 0;
}
@@ -660,7 +664,8 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
urb_init = 1;
if (urb_init) {
rc = em28xx_prepare_isoc(dev, EM28XX_NUM_PACKETS, EM28XX_NUM_BUFS);
rc = em28xx_prepare_isoc(dev, EM28XX_NUM_PACKETS,
EM28XX_NUM_BUFS);
if (rc < 0)
goto fail;