diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2009-03-03 20:21:03 -0800 |
---|---|---|
committer | Trent Piepho <xyzzy@speakeasy.org> | 2009-03-03 20:21:03 -0800 |
commit | b8a69a37f416564efc1f148e4cfb3f5f95f30abb (patch) | |
tree | 3673b335c768c58dd0eb898fc036ee48e0889edc /linux | |
parent | 32096c8cae65c6bb6388033e00b0d5e14c99d934 (diff) | |
download | mediapointer-dvb-s2-b8a69a37f416564efc1f148e4cfb3f5f95f30abb.tar.gz mediapointer-dvb-s2-b8a69a37f416564efc1f148e4cfb3f5f95f30abb.tar.bz2 |
bttv: Don't need to zero ioctl parameter fields
From: Trent Piepho <xyzzy@speakeasy.org>
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.
Priority: normal
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/bt8xx/bttv-driver.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c index f95a4f811..d34898f95 100644 --- a/linux/drivers/media/video/bt8xx/bttv-driver.c +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c @@ -1922,16 +1922,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; @@ -2980,7 +2975,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"); @@ -3523,7 +3517,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; |