diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-06-21 07:57:42 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:10:48 -0400 |
commit | 8bfb9b1ce62757b8dea07c239efbbeec7bac811a (patch) | |
tree | b5b340bde2dd780c59998bbb6246ab3bdc648095 | |
parent | 3b6fe58f0f18880200969e813d0181d1bdab0966 (diff) |
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: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/videodev.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index 9c539eb33811..0d56305c153e 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c | |||
@@ -1616,26 +1616,26 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
1616 | } | 1616 | } |
1617 | case VIDIOC_ENCODER_CMD: | 1617 | case VIDIOC_ENCODER_CMD: |
1618 | { | 1618 | { |
1619 | struct v4l2_encoder_cmd *p=arg; | 1619 | struct v4l2_encoder_cmd *p = arg; |
1620 | 1620 | ||
1621 | if (!vfd->vidioc_encoder_cmd) | 1621 | if (!vfd->vidioc_encoder_cmd) |
1622 | break; | 1622 | break; |
1623 | ret=vfd->vidioc_encoder_cmd(file, fh, p); | 1623 | memset(&p->raw, 0, sizeof(p->raw)); |
1624 | ret = vfd->vidioc_encoder_cmd(file, fh, p); | ||
1624 | if (!ret) | 1625 | if (!ret) |
1625 | dbgarg (cmd, "cmd=%d, flags=%d\n", | 1626 | dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags); |
1626 | p->cmd,p->flags); | ||
1627 | break; | 1627 | break; |
1628 | } | 1628 | } |
1629 | case VIDIOC_TRY_ENCODER_CMD: | 1629 | case VIDIOC_TRY_ENCODER_CMD: |
1630 | { | 1630 | { |
1631 | struct v4l2_encoder_cmd *p=arg; | 1631 | struct v4l2_encoder_cmd *p = arg; |
1632 | 1632 | ||
1633 | if (!vfd->vidioc_try_encoder_cmd) | 1633 | if (!vfd->vidioc_try_encoder_cmd) |
1634 | break; | 1634 | break; |
1635 | ret=vfd->vidioc_try_encoder_cmd(file, fh, p); | 1635 | memset(&p->raw, 0, sizeof(p->raw)); |
1636 | ret = vfd->vidioc_try_encoder_cmd(file, fh, p); | ||
1636 | if (!ret) | 1637 | if (!ret) |
1637 | dbgarg (cmd, "cmd=%d, flags=%d\n", | 1638 | dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags); |
1638 | p->cmd,p->flags); | ||
1639 | break; | 1639 | break; |
1640 | } | 1640 | } |
1641 | case VIDIOC_G_PARM: | 1641 | case VIDIOC_G_PARM: |
@@ -1738,12 +1738,17 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
1738 | } | 1738 | } |
1739 | case VIDIOC_G_SLICED_VBI_CAP: | 1739 | case VIDIOC_G_SLICED_VBI_CAP: |
1740 | { | 1740 | { |
1741 | struct v4l2_sliced_vbi_cap *p=arg; | 1741 | struct v4l2_sliced_vbi_cap *p = arg; |
1742 | __u32 type = p->type; | ||
1743 | |||
1742 | if (!vfd->vidioc_g_sliced_vbi_cap) | 1744 | if (!vfd->vidioc_g_sliced_vbi_cap) |
1743 | break; | 1745 | break; |
1744 | ret=vfd->vidioc_g_sliced_vbi_cap(file, fh, p); | 1746 | memset(p, 0, sizeof(*p)); |
1747 | p->type = type; | ||
1748 | ret = vfd->vidioc_g_sliced_vbi_cap(file, fh, p); | ||
1745 | if (!ret) | 1749 | if (!ret) |
1746 | dbgarg (cmd, "service_set=%d\n", p->service_set); | 1750 | dbgarg(cmd, "type=%d, service_set=%d\n", |
1751 | p->type, p->service_set); | ||
1747 | break; | 1752 | break; |
1748 | } | 1753 | } |
1749 | case VIDIOC_LOG_STATUS: | 1754 | case VIDIOC_LOG_STATUS: |