Commit 38367255 authored by Trent Piepho's avatar Trent Piepho Committed by Mauro Carvalho Chehab

V4L/DVB (10818): usbvision: Don't need to zero ioctl parameter fields

The v4l2 core code in v4l2_ioctl will zero out the structure the driver is
supposed to fill in for read-only ioctls.  For read/write ioctls, all the
fields which aren't supplied from userspace will be zeroed out.

Zeroing code is removed from g_audio, queryctrl, and enum_fmt_vid_cap.
Signed-off-by: default avatarTrent Piepho <xyzzy@speakeasy.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent df7bdfcd
...@@ -697,7 +697,6 @@ static int vidioc_g_audio (struct file *file, void *priv, struct v4l2_audio *a) ...@@ -697,7 +697,6 @@ static int vidioc_g_audio (struct file *file, void *priv, struct v4l2_audio *a)
{ {
struct usb_usbvision *usbvision = video_drvdata(file); struct usb_usbvision *usbvision = video_drvdata(file);
memset(a,0,sizeof(*a));
if(usbvision->radio) { if(usbvision->radio) {
strcpy(a->name,"Radio"); strcpy(a->name,"Radio");
} else { } else {
...@@ -721,10 +720,6 @@ static int vidioc_queryctrl (struct file *file, void *priv, ...@@ -721,10 +720,6 @@ static int vidioc_queryctrl (struct file *file, void *priv,
struct v4l2_queryctrl *ctrl) struct v4l2_queryctrl *ctrl)
{ {
struct usb_usbvision *usbvision = video_drvdata(file); struct usb_usbvision *usbvision = video_drvdata(file);
int id=ctrl->id;
memset(ctrl,0,sizeof(*ctrl));
ctrl->id=id;
call_all(usbvision, core, queryctrl, ctrl); call_all(usbvision, core, queryctrl, ctrl);
...@@ -926,11 +921,9 @@ static int vidioc_enum_fmt_vid_cap (struct file *file, void *priv, ...@@ -926,11 +921,9 @@ static int vidioc_enum_fmt_vid_cap (struct file *file, void *priv,
if(vfd->index>=USBVISION_SUPPORTED_PALETTES-1) { if(vfd->index>=USBVISION_SUPPORTED_PALETTES-1) {
return -EINVAL; return -EINVAL;
} }
vfd->flags = 0;
vfd->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; vfd->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
strcpy(vfd->description,usbvision_v4l2_format[vfd->index].desc); strcpy(vfd->description,usbvision_v4l2_format[vfd->index].desc);
vfd->pixelformat = usbvision_v4l2_format[vfd->index].format; vfd->pixelformat = usbvision_v4l2_format[vfd->index].format;
memset(vfd->reserved, 0, sizeof(vfd->reserved));
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment