videobuf2: Fix vb2_write prototype
Subsystems (2)
PATCH 1/1 videobuf2: Fix vb2_write prototype
struct v4_file_operations defines the data param as const char __user *data but on vb2 is defined as char __user *data.
This patch fixes the warnings produced by this. ie:
drivers/qtec/qtec_xform.c:817:2: warning: initialization from incompatible pointer type [enabled by default] drivers/qtec/qtec_xform.c:817:2: warning: (near initialization for
‘qtec_xform_v4l_fops.write’) [enabled by default]
--- drivers/media/v4l2-core/videobuf2-core.c | 7 ++++--- include/media/videobuf2-core.h | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/media/v4l2-core/videobuf2-core.c +4 -3
@@ -2438,10 +2438,11 @@ size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count, }EXPORT_SYMBOL_GPL (vb2_read); -size_t vb2_write (struct vb2_queue *q,char __user *data,size_t count, +size_t vb2_write (struct vb2_queue *q,const char __user *data,size_t count,loff_t *ppos,int nonblocking) { -return __vb2_perform_fileio (q, data, count, ppos, nonblocking,0 ); +return __vb2_perform_fileio (q, (char __user *) data, count, + ppos, nonblocking,0 ); }EXPORT_SYMBOL_GPL (vb2_write);
@@ -2595,7 +2596,7 @@ int vb2_fop_release(struct file *file) }EXPORT_SYMBOL_GPL (vb2_fop_release); -ssize_t vb2_fop_write (struct file *file,char __user *buf, +ssize_t vb2_fop_write (struct file *file,const char __user *buf,size_t count,loff_t *ppos) {struct video_device *vdev =video_devdata (file);
include/media/videobuf2-core.h +2 -2
@@ -388,7 +388,7 @@ unsigned long vb2_get_unmapped_area(struct vb2_queue *q,unsigned int vb2_poll (struct vb2_queue *q,struct file *file,poll_table *wait);size_t vb2_read (struct vb2_queue *q,char __user *data,size_t count,loff_t *ppos,int nonblock); -size_t vb2_write (struct vb2_queue *q,char __user *data,size_t count, +size_t vb2_write (struct vb2_queue *q,const char __user *data,size_t count,loff_t *ppos,int nonblock);/**
@@ -488,7 +488,7 @@ int vb2_ioctl_expbuf(struct file *file, void *priv,int vb2_fop_mmap (struct file *file,struct vm_area_struct *vma);int vb2_fop_release (struct file *file); -ssize_t vb2_fop_write (struct file *file,char __user *buf, +ssize_t vb2_fop_write (struct file *file,const char __user *buf,size_t count,loff_t *ppos);ssize_t vb2_fop_read (struct file *file,char __user *buf,size_t count,loff_t *ppos);
Signature · 1 line
1.7.10.4
Hello,
Quoted 4 lines · Ricardo Ribalda Delgado
struct
v4_file_operationsdefines the data param as const char__user*data but on vb2 is defined as char__user*data.
Quoted 8 lines
This patch fixes the warnings produced by this. ie:
drivers/qtec/qtec_xform.c:817:2: warning: initialization from incompatible pointer type [enabled by default]drivers/qtec/qtec_xform.c:817:2: warning: (near initialization for
‘qtec_xform_v4l_fops.write’) [enabled by default]Signed-off-by Ricardo Ribalda Delgado <[email protected]>
Quoted 46 lines
--- drivers/media/v4l2-core/videobuf2-core.c | 7 ++++--- include/media/videobuf2-core.h | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-)drivers/media/v4l2-core/videobuf2-core.c +4
-3@@ -2438,10 +2438,11 @@ size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count, }EXPORT_SYMBOL_GPL (vb2_read); -size_t vb2_write (struct vb2_queue *q,char __user *data,size_t count, +size_t vb2_write (struct vb2_queue *q,const char __user *data,size_t count,loff_t *ppos,int nonblocking) { -return __vb2_perform_fileio (q, data, count, ppos, nonblocking,0 ); +return __vb2_perform_fileio (q, (char __user *) data, count, + ppos, nonblocking,0 ); }EXPORT_SYMBOL_GPL (vb2_write);@@ -2595,7 +2596,7 @@ int vb2_fop_release(struct file *file) }EXPORT_SYMBOL_GPL (vb2_fop_release); -ssize_t vb2_fop_write (struct file *file,char __user *buf, +ssize_t vb2_fop_write (struct file *file,const char __user *buf,size_t count,loff_t *ppos) {struct video_device *vdev =video_devdata (file);include/media/videobuf2-core.h +1
-1@@ -388,7 +388,7 @@ unsigned long vb2_get_unmapped_area(struct vb2_queue *q,unsigned int vb2_poll (struct vb2_queue *q,struct file *file,poll_table *wait);size_t vb2_read (struct vb2_queue *q,char __user *data,size_t count,loff_t *ppos,int nonblock); -size_t vb2_write (struct vb2_queue *q,char __user *data,size_t count, +size_t vb2_write (struct vb2_queue *q,const char __user *data,size_t count,loff_t *ppos,int nonblock);/**
include/media/videobuf2-core.h int vb2_ioctl_expbuf(struct file *file, void *priv, · line 494
Quoted 8 lines
include/media/videobuf2-core.h +1
-1@@ -488,7 +488,7 @@ int vb2_ioctl_expbuf(struct file *file, void *priv,int vb2_fop_mmap (struct file *file,struct vm_area_struct *vma);int vb2_fop_release (struct file *file); -ssize_t vb2_fop_write (struct file *file,char __user *buf, +ssize_t vb2_fop_write (struct file *file,const char __user *buf,size_t count,loff_t *ppos);ssize_t vb2_fop_read (struct file *file,char __user *buf,size_t count,loff_t *ppos);
Best regards
Signature · 2 lines
Marek Szyprowski Samsung R&D Institute Poland