diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2009-03-03 23:21:03 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:06 -0400 |
commit | 522a5f1430bb85ca00928b99caf3892023ad9632 (patch) | |
tree | 93431dfd3264cf94e2bed89885e703817396a84b | |
parent | 717167e8ae13a61649a1faf867279440fee70b56 (diff) |
V4L/DVB (10815): bttv: 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 and g_tuner.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/bt8xx/bttv-driver.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 1f606d816a58..b5fc3cc61888 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c | |||
@@ -1894,16 +1894,11 @@ static int bttv_enum_input(struct file *file, void *priv, | |||
1894 | { | 1894 | { |
1895 | struct bttv_fh *fh = priv; | 1895 | struct bttv_fh *fh = priv; |
1896 | struct bttv *btv = fh->btv; | 1896 | struct bttv *btv = fh->btv; |
1897 | unsigned int n; | 1897 | int n; |
1898 | 1898 | ||
1899 | n = i->index; | 1899 | if (i->index >= bttv_tvcards[btv->c.type].video_inputs) |
1900 | |||
1901 | if (n >= bttv_tvcards[btv->c.type].video_inputs) | ||
1902 | return -EINVAL; | 1900 | return -EINVAL; |
1903 | 1901 | ||
1904 | memset(i, 0, sizeof(*i)); | ||
1905 | |||
1906 | i->index = n; | ||
1907 | i->type = V4L2_INPUT_TYPE_CAMERA; | 1902 | i->type = V4L2_INPUT_TYPE_CAMERA; |
1908 | i->audioset = 1; | 1903 | i->audioset = 1; |
1909 | 1904 | ||
@@ -2952,7 +2947,6 @@ static int bttv_g_tuner(struct file *file, void *priv, | |||
2952 | return -EINVAL; | 2947 | return -EINVAL; |
2953 | 2948 | ||
2954 | mutex_lock(&btv->lock); | 2949 | mutex_lock(&btv->lock); |
2955 | memset(t, 0, sizeof(*t)); | ||
2956 | t->rxsubchans = V4L2_TUNER_SUB_MONO; | 2950 | t->rxsubchans = V4L2_TUNER_SUB_MONO; |
2957 | bttv_call_i2c_clients(btv, VIDIOC_G_TUNER, t); | 2951 | bttv_call_i2c_clients(btv, VIDIOC_G_TUNER, t); |
2958 | strcpy(t->name, "Television"); | 2952 | strcpy(t->name, "Television"); |
@@ -3495,7 +3489,6 @@ static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t) | |||
3495 | if (0 != t->index) | 3489 | if (0 != t->index) |
3496 | return -EINVAL; | 3490 | return -EINVAL; |
3497 | mutex_lock(&btv->lock); | 3491 | mutex_lock(&btv->lock); |
3498 | memset(t, 0, sizeof(*t)); | ||
3499 | strcpy(t->name, "Radio"); | 3492 | strcpy(t->name, "Radio"); |
3500 | t->type = V4L2_TUNER_RADIO; | 3493 | t->type = V4L2_TUNER_RADIO; |
3501 | 3494 | ||