Commit 8bfb9b1c authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (8083): videodev: zero fields for ENCODER_CMD and VIDIOC_G_SLICED_VBI_CAP



This avoids the need of memsets in the ivtv/cx18 drivers.

Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 3b6fe58f
Loading
Loading
Loading
Loading
+16 −11
Original line number Diff line number Diff line
@@ -1620,10 +1620,10 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,

		if (!vfd->vidioc_encoder_cmd)
			break;
		memset(&p->raw, 0, sizeof(p->raw));
		ret = vfd->vidioc_encoder_cmd(file, fh, p);
		if (!ret)
			dbgarg (cmd, "cmd=%d, flags=%d\n",
					p->cmd,p->flags);
			dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags);
		break;
	}
	case VIDIOC_TRY_ENCODER_CMD:
@@ -1632,10 +1632,10 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,

		if (!vfd->vidioc_try_encoder_cmd)
			break;
		memset(&p->raw, 0, sizeof(p->raw));
		ret = vfd->vidioc_try_encoder_cmd(file, fh, p);
		if (!ret)
			dbgarg (cmd, "cmd=%d, flags=%d\n",
					p->cmd,p->flags);
			dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags);
		break;
	}
	case VIDIOC_G_PARM:
@@ -1739,11 +1739,16 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
	case VIDIOC_G_SLICED_VBI_CAP:
	{
		struct v4l2_sliced_vbi_cap *p = arg;
		__u32 type = p->type;

		if (!vfd->vidioc_g_sliced_vbi_cap)
			break;
		memset(p, 0, sizeof(*p));
		p->type = type;
		ret = vfd->vidioc_g_sliced_vbi_cap(file, fh, p);
		if (!ret)
			dbgarg (cmd, "service_set=%d\n", p->service_set);
			dbgarg(cmd, "type=%d, service_set=%d\n",
					p->type, p->service_set);
		break;
	}
	case VIDIOC_LOG_STATUS: