V4L/DVB: v4l: videobuf: code cleanup

Make videobuf pass checkpatch; minor code cleanups.

Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Pawel Osciak
2010-03-17 04:01:04 -03:00
committed by Mauro Carvalho Chehab
parent 85e092190b
commit 7a02264ca9
6 changed files with 272 additions and 281 deletions

View File

@@ -129,14 +129,14 @@ struct videobuf_qtype_ops {
void *(*alloc) (size_t size);
void *(*vmalloc) (struct videobuf_buffer *buf);
int (*iolock) (struct videobuf_queue* q,
int (*iolock) (struct videobuf_queue *q,
struct videobuf_buffer *vb,
struct v4l2_framebuffer *fbuf);
int (*mmap) (struct videobuf_queue *q,
unsigned int *count,
unsigned int *size,
enum v4l2_memory memory);
int (*sync) (struct videobuf_queue* q,
int (*sync) (struct videobuf_queue *q,
struct videobuf_buffer *buf);
int (*video_copy_to_user)(struct videobuf_queue *q,
char __user *data,
@@ -185,14 +185,14 @@ struct videobuf_queue {
};
int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr);
int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb,
int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb,
struct v4l2_framebuffer *fbuf);
void *videobuf_alloc(struct videobuf_queue* q);
/* Used on videobuf-dvb */
void *videobuf_queue_to_vmalloc (struct videobuf_queue* q,
struct videobuf_buffer *buf);
void *videobuf_queue_to_vmalloc(struct videobuf_queue *q,
struct videobuf_buffer *buf);
void videobuf_queue_core_init(struct videobuf_queue *q,
const struct videobuf_queue_ops *ops,

View File

@@ -17,6 +17,8 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2
*/
#ifndef _VIDEOBUF_DMA_SG_H
#define _VIDEOBUF_DMA_SG_H
#include <media/videobuf-core.h>
@@ -27,14 +29,14 @@
* block (NULL on errors). Memory for the scatterlist is allocated
* using kmalloc. The caller must free the memory.
*/
struct scatterlist* videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages);
struct scatterlist *videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages);
/*
* Return a scatterlist for a an array of userpages (NULL on errors).
* Memory for the scatterlist is allocated using kmalloc. The caller
* must free the memory.
*/
struct scatterlist* videobuf_pages_to_sg(struct page **pages, int nr_pages,
struct scatterlist *videobuf_pages_to_sg(struct page **pages, int nr_pages,
int offset);
/* --------------------------------------------------------------------- */
@@ -78,8 +80,7 @@ struct videobuf_dmabuf {
int direction;
};
struct videobuf_dma_sg_memory
{
struct videobuf_dma_sg_memory {
u32 magic;
/* for mmap'ed buffers */
@@ -95,14 +96,14 @@ int videobuf_dma_init_overlay(struct videobuf_dmabuf *dma, int direction,
dma_addr_t addr, int nr_pages);
int videobuf_dma_free(struct videobuf_dmabuf *dma);
int videobuf_dma_map(struct videobuf_queue* q,struct videobuf_dmabuf *dma);
int videobuf_dma_sync(struct videobuf_queue* q,struct videobuf_dmabuf *dma);
int videobuf_dma_unmap(struct videobuf_queue* q,struct videobuf_dmabuf *dma);
struct videobuf_dmabuf *videobuf_to_dma (struct videobuf_buffer *buf);
int videobuf_dma_map(struct videobuf_queue *q, struct videobuf_dmabuf *dma);
int videobuf_dma_sync(struct videobuf_queue *q, struct videobuf_dmabuf *dma);
int videobuf_dma_unmap(struct videobuf_queue *q, struct videobuf_dmabuf *dma);
struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf);
void *videobuf_sg_alloc(size_t size);
void videobuf_queue_sg_init(struct videobuf_queue* q,
void videobuf_queue_sg_init(struct videobuf_queue *q,
const struct videobuf_queue_ops *ops,
struct device *dev,
spinlock_t *irqlock,
@@ -111,9 +112,11 @@ void videobuf_queue_sg_init(struct videobuf_queue* q,
unsigned int msize,
void *priv);
/*FIXME: these variants are used only on *-alsa code, where videobuf is
* used without queue
*/
/*FIXME: these variants are used only on *-alsa code, where videobuf is
* used without queue
*/
int videobuf_sg_dma_map(struct device *dev, struct videobuf_dmabuf *dma);
int videobuf_sg_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma);
#endif /* _VIDEOBUF_DMA_SG_H */

View File

@@ -19,17 +19,17 @@
/* --------------------------------------------------------------------- */
struct videobuf_vmalloc_memory
{
struct videobuf_vmalloc_memory {
u32 magic;
void *vmalloc;
/* remap_vmalloc_range seems to need to run after mmap() on some cases */
/* remap_vmalloc_range seems to need to run
* after mmap() on some cases */
struct vm_area_struct *vma;
};
void videobuf_queue_vmalloc_init(struct videobuf_queue* q,
void videobuf_queue_vmalloc_init(struct videobuf_queue *q,
const struct videobuf_queue_ops *ops,
struct device *dev,
spinlock_t *irqlock,
@@ -38,8 +38,8 @@ void videobuf_queue_vmalloc_init(struct videobuf_queue* q,
unsigned int msize,
void *priv);
void *videobuf_to_vmalloc (struct videobuf_buffer *buf);
void *videobuf_to_vmalloc(struct videobuf_buffer *buf);
void videobuf_vmalloc_free (struct videobuf_buffer *buf);
void videobuf_vmalloc_free(struct videobuf_buffer *buf);
#endif