* [PATCH] videobuf-vmallloc: cleanup
@ 2008-07-18 15:22 Paulius Zaleckas
0 siblings, 0 replies; only message in thread
From: Paulius Zaleckas @ 2008-07-18 15:22 UTC (permalink / raw)
To: video4linux-list
[-- Attachment #1: videobuf-vmalloc_cleanup.patch --]
[-- Type: text/x-patch, Size: 2776 bytes --]
videobuf-vmalloc cleanup:
- remove not used MAGIC_DMABUF define
- remove not needed return;
- remove dead code (#if 0 and etc.)
- remove editor settings
- reorganize __videobuf_mmap_free()
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Index: linux-2.6/drivers/media/video/videobuf-vmalloc.c
===================================================================
--- linux-2.6.orig/drivers/media/video/videobuf-vmalloc.c
+++ linux-2.6/drivers/media/video/videobuf-vmalloc.c
@@ -27,7 +27,6 @@
#include <media/videobuf-vmalloc.h>
-#define MAGIC_DMABUF 0x17760309
#define MAGIC_VMAL_MEM 0x18221223
#define MAGIC_CHECK(is,should) if (unlikely((is) != (should))) \
@@ -46,8 +45,7 @@ MODULE_LICENSE("GPL");
/***************************************************************************/
-static void
-videobuf_vm_open(struct vm_area_struct *vma)
+static void videobuf_vm_open(struct vm_area_struct *vma)
{
struct videobuf_mapping *map = vma->vm_private_data;
@@ -112,8 +110,6 @@ static void videobuf_vm_close(struct vm_
mutex_unlock(&q->vb_lock);
}
-
- return;
}
static struct vm_operations_struct videobuf_vm_ops =
@@ -175,12 +171,10 @@ static int __videobuf_iolock (struct vid
dprintk(1, "%s memory method USERPTR\n", __func__);
-#if 1
if (vb->baddr) {
printk(KERN_ERR "USERPTR is currently not supported\n");
return -EINVAL;
}
-#endif
/* The only USERPTR currently supported is the one needed for
read() method.
@@ -194,25 +188,6 @@ static int __videobuf_iolock (struct vid
dprintk(1, "vmalloc is at addr %p (%d pages)\n",
mem->vmalloc, pages);
-#if 0
- int rc;
- /* Kernel userptr is used also by read() method. In this case,
- there's no need to remap, since data will be copied to user
- */
- if (!vb->baddr)
- return 0;
-
- /* FIXME: to properly support USERPTR, remap should occur.
- The code bellow won't work, since mem->vma = NULL
- */
- /* Try to remap memory */
- rc = remap_vmalloc_range(mem->vma, (void *)vb->baddr, 0);
- if (rc < 0) {
- printk(KERN_ERR "mmap: remap failed with error %d. ", rc);
- return -ENOMEM;
- }
-#endif
-
break;
case V4L2_MEMORY_OVERLAY:
default:
@@ -237,12 +212,9 @@ static int __videobuf_mmap_free(struct v
unsigned int i;
dprintk(1, "%s\n", __func__);
- for (i = 0; i < VIDEO_MAX_FRAME; i++) {
- if (q->bufs[i]) {
- if (q->bufs[i]->map)
- return -EBUSY;
- }
- }
+ for (i = 0; i < VIDEO_MAX_FRAME; i++)
+ if (q->bufs[i] && q->bufs[i]->map)
+ return -EBUSY;
return 0;
}
@@ -435,13 +407,5 @@ void videobuf_vmalloc_free (struct video
vfree(mem->vmalloc);
mem->vmalloc = NULL;
-
- return;
}
EXPORT_SYMBOL_GPL(videobuf_vmalloc_free);
-
-/*
- * Local variables:
- * c-basic-offset: 8
- * End:
- */
[-- Attachment #2: Type: text/plain, Size: 164 bytes --]
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-07-18 15:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-18 15:22 [PATCH] videobuf-vmallloc: cleanup Paulius Zaleckas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox