]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (10815): bttv: Don't need to zero ioctl parameter fields
authorTrent Piepho <xyzzy@speakeasy.org>
Wed, 4 Mar 2009 04:21:03 +0000 (01:21 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:43:06 +0000 (12:43 -0300)
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 and g_tuner.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/bt8xx/bttv-driver.c

index 1f606d816a58365f4ef535428ee465948c969468..b5fc3cc61888d01757d438598578da1fb6d59230 100644 (file)
@@ -1894,16 +1894,11 @@ static int bttv_enum_input(struct file *file, void *priv,
 {
        struct bttv_fh *fh = priv;
        struct bttv *btv = fh->btv;
-       unsigned int n;
+       int n;
 
-       n = i->index;
-
-       if (n >= bttv_tvcards[btv->c.type].video_inputs)
+       if (i->index >= bttv_tvcards[btv->c.type].video_inputs)
                return -EINVAL;
 
-       memset(i, 0, sizeof(*i));
-
-       i->index    = n;
        i->type     = V4L2_INPUT_TYPE_CAMERA;
        i->audioset = 1;
 
@@ -2952,7 +2947,6 @@ static int bttv_g_tuner(struct file *file, void *priv,
                return -EINVAL;
 
        mutex_lock(&btv->lock);
-       memset(t, 0, sizeof(*t));
        t->rxsubchans = V4L2_TUNER_SUB_MONO;
        bttv_call_i2c_clients(btv, VIDIOC_G_TUNER, t);
        strcpy(t->name, "Television");
@@ -3495,7 +3489,6 @@ static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
        if (0 != t->index)
                return -EINVAL;
        mutex_lock(&btv->lock);
-       memset(t, 0, sizeof(*t));
        strcpy(t->name, "Radio");
        t->type = V4L2_TUNER_RADIO;