mirror of
https://github.com/adulau/aha.git
synced 2025-01-02 14:13:18 +00:00
V4L/DVB (6759): CodingStyle fixes
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
543323bcf4
commit
e2c77314c9
1 changed files with 146 additions and 146 deletions
|
@ -22,18 +22,21 @@
|
||||||
#include <media/videobuf-core.h>
|
#include <media/videobuf-core.h>
|
||||||
|
|
||||||
#define MAGIC_BUFFER 0x20070728
|
#define MAGIC_BUFFER 0x20070728
|
||||||
#define MAGIC_CHECK(is,should) if (unlikely((is) != (should))) \
|
#define MAGIC_CHECK(is, should) do { \
|
||||||
{ printk(KERN_ERR "magic mismatch: %x (expected %x)\n",is,should); BUG(); }
|
if (unlikely((is) != (should))) { \
|
||||||
|
printk(KERN_ERR "magic mismatch: %x (expected %x)\n", is, should); \
|
||||||
|
BUG(); } } while (0)
|
||||||
|
|
||||||
static int debug = 0;
|
static int debug;
|
||||||
module_param(debug, int, 0644);
|
module_param(debug, int, 0644);
|
||||||
|
|
||||||
MODULE_DESCRIPTION("helper module to manage video4linux buffers");
|
MODULE_DESCRIPTION("helper module to manage video4linux buffers");
|
||||||
MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
|
MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
|
|
||||||
#define dprintk(level, fmt, arg...) if (debug >= level) \
|
#define dprintk(level, fmt, arg...) do { \
|
||||||
printk(KERN_DEBUG "vbuf: " fmt , ## arg)
|
if (debug >= level) \
|
||||||
|
printk(KERN_DEBUG "vbuf: " fmt , ## arg); } while (0)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
@ -75,7 +78,8 @@ int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr)
|
||||||
}
|
}
|
||||||
set_current_state(intr ? TASK_INTERRUPTIBLE
|
set_current_state(intr ? TASK_INTERRUPTIBLE
|
||||||
: TASK_UNINTERRUPTIBLE);
|
: TASK_UNINTERRUPTIBLE);
|
||||||
if (vb->state == VIDEOBUF_ACTIVE || vb->state == VIDEOBUF_QUEUED)
|
if (vb->state == VIDEOBUF_ACTIVE ||
|
||||||
|
vb->state == VIDEOBUF_QUEUED)
|
||||||
schedule();
|
schedule();
|
||||||
set_current_state(TASK_RUNNING);
|
set_current_state(TASK_RUNNING);
|
||||||
if (intr && signal_pending(current)) {
|
if (intr && signal_pending(current)) {
|
||||||
|
@ -94,8 +98,8 @@ int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb,
|
||||||
MAGIC_CHECK(vb->magic, MAGIC_BUFFER);
|
MAGIC_CHECK(vb->magic, MAGIC_BUFFER);
|
||||||
MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);
|
MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);
|
||||||
|
|
||||||
/* FIXME: This is required to avoid OOPS on some cases, since mmap_mapper()
|
/* FIXME: This is required to avoid OOPS on some cases,
|
||||||
method should be called before _iolock.
|
since mmap_mapper() method should be called before _iolock.
|
||||||
On some cases, the mmap_mapper() is called only after scheduling.
|
On some cases, the mmap_mapper() is called only after scheduling.
|
||||||
|
|
||||||
However, this way is just too dirty! Better to wait for some event.
|
However, this way is just too dirty! Better to wait for some event.
|
||||||
|
@ -516,7 +520,8 @@ int videobuf_qbuf(struct videobuf_queue *q,
|
||||||
switch (b->memory) {
|
switch (b->memory) {
|
||||||
case V4L2_MEMORY_MMAP:
|
case V4L2_MEMORY_MMAP:
|
||||||
if (0 == buf->baddr) {
|
if (0 == buf->baddr) {
|
||||||
dprintk(1,"qbuf: mmap requested but buffer addr is zero!\n");
|
dprintk(1, "qbuf: mmap requested "
|
||||||
|
"but buffer addr is zero!\n");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -525,7 +530,8 @@ int videobuf_qbuf(struct videobuf_queue *q,
|
||||||
dprintk(1, "qbuf: buffer length is not enough\n");
|
dprintk(1, "qbuf: buffer length is not enough\n");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (VIDEOBUF_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr)
|
if (VIDEOBUF_NEEDS_INIT != buf->state &&
|
||||||
|
buf->baddr != b->m.userptr)
|
||||||
q->ops->buf_release(q, buf);
|
q->ops->buf_release(q, buf);
|
||||||
buf->baddr = b->m.userptr;
|
buf->baddr = b->m.userptr;
|
||||||
break;
|
break;
|
||||||
|
@ -1079,9 +1085,3 @@ EXPORT_SYMBOL_GPL(videobuf_poll_stream);
|
||||||
EXPORT_SYMBOL_GPL(videobuf_mmap_setup);
|
EXPORT_SYMBOL_GPL(videobuf_mmap_setup);
|
||||||
EXPORT_SYMBOL_GPL(videobuf_mmap_free);
|
EXPORT_SYMBOL_GPL(videobuf_mmap_free);
|
||||||
EXPORT_SYMBOL_GPL(videobuf_mmap_mapper);
|
EXPORT_SYMBOL_GPL(videobuf_mmap_mapper);
|
||||||
|
|
||||||
/*
|
|
||||||
* Local variables:
|
|
||||||
* c-basic-offset: 8
|
|
||||||
* End:
|
|
||||||
*/
|
|
||||||
|
|
Loading…
Reference in a new issue