]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
V4L/DVB (11268): cx23885-417: Don't need to zero ioctl parameter fields
authorTrent Piepho <xyzzy@speakeasy.org>
Sun, 29 Mar 2009 01:25:36 +0000 (22:25 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:43:45 +0000 (12:43 -0300)
commitf29816bc317704a33b15269b9e2201de3c9d6a79
treef6252362f466191efa6a9551c2cf2a62291387eb
parente33ee31ac39620c2f91bd8c057982f94a31df958
V4L/DVB (11268): cx23885-417: 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 enum_input, g_tuner, g_frequency, querycap,
enum_fmt_vid_cap, g_fmt_vid_cap, and try_fmt_vid_cap.

The ->vidioc_(s|g|try|enum)_fmt_vid_cap() methods are only called on
VIDEO_CAPTURE buffers.  Thus, there is no need to check or set the buffer's
'type' field since it must already be set to VIDEO_CAPTURE.

There also appeared to be a copy and paste error in
vidioc_try_fmt_vid_cap() that would set f->fmt.pix.sizeimage to zero.

Note that the s_fmt_vid_cap method doesn't appear to actually do anything.
Whatever parameters were requested are just silently ignored.  Was this
intentional?  Who knows, as the commit log entry for the driver just says,
"Add generic cx23417 hardware encoder support." There are no docs.  A
comment like "this driver totally ignores the v4l2 spec w.r.t.
VIDIOC_S_FMT because ..." would have gone a long way.

Cc: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx23885/cx23885-417.c