diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-06-21 08:02:36 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:10:52 -0400 |
commit | 79afcb10dfdd3287875666de34c23510423058b8 (patch) | |
tree | c3077b28e53a79b1ec25f84c3cbf6fac8eb7f865 | |
parent | 8bfb9b1ce62757b8dea07c239efbbeec7bac811a (diff) |
V4L/DVB (8084): ivtv/cx18: remove unnecessary memsets & KERNEL_VERSION tests
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/cx18/cx18-ioctl.c | 4 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-ioctl.c | 22 |
2 files changed, 7 insertions, 19 deletions
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c index 70afedf4763f..395382798fb8 100644 --- a/drivers/media/video/cx18/cx18-ioctl.c +++ b/drivers/media/video/cx18/cx18-ioctl.c | |||
@@ -679,8 +679,6 @@ static int cx18_encoder_cmd(struct file *file, void *fh, | |||
679 | 679 | ||
680 | CX18_DEBUG_IOCTL("VIDIOC_ENCODER_CMD:\n"); | 680 | CX18_DEBUG_IOCTL("VIDIOC_ENCODER_CMD:\n"); |
681 | 681 | ||
682 | memset(&enc->raw, 0, sizeof(enc->raw)); | ||
683 | |||
684 | switch (enc->cmd) { | 682 | switch (enc->cmd) { |
685 | case V4L2_ENC_CMD_START: | 683 | case V4L2_ENC_CMD_START: |
686 | CX18_DEBUG_IOCTL("V4L2_ENC_CMD_START\n"); | 684 | CX18_DEBUG_IOCTL("V4L2_ENC_CMD_START\n"); |
@@ -730,8 +728,6 @@ static int cx18_try_encoder_cmd(struct file *file, void *fh, | |||
730 | 728 | ||
731 | CX18_DEBUG_IOCTL("VIDIOC_TRY_ENCDOER_CMD:\n"); | 729 | CX18_DEBUG_IOCTL("VIDIOC_TRY_ENCDOER_CMD:\n"); |
732 | 730 | ||
733 | memset(&enc->raw, 0, sizeof(enc->raw)); | ||
734 | |||
735 | switch (enc->cmd) { | 731 | switch (enc->cmd) { |
736 | case V4L2_ENC_CMD_START: | 732 | case V4L2_ENC_CMD_START: |
737 | CX18_DEBUG_IOCTL("V4L2_ENC_CMD_START\n"); | 733 | CX18_DEBUG_IOCTL("V4L2_ENC_CMD_START\n"); |
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index e1a31830e9f6..eb4485991a58 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c | |||
@@ -508,6 +508,11 @@ static int ivtv_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format | |||
508 | ivtv_g_fmt_vid_cap(file, fh, fmt); | 508 | ivtv_g_fmt_vid_cap(file, fh, fmt); |
509 | fmt->fmt.pix.width = w; | 509 | fmt->fmt.pix.width = w; |
510 | fmt->fmt.pix.height = h; | 510 | fmt->fmt.pix.height = h; |
511 | if (itv->params.width != 720 || | ||
512 | itv->params.height != (itv->is_50hz ? 576 : 480)) | ||
513 | itv->params.video_temporal_filter = 0; | ||
514 | else | ||
515 | itv->params.video_temporal_filter = 8; | ||
511 | return 0; | 516 | return 0; |
512 | } | 517 | } |
513 | 518 | ||
@@ -762,15 +767,11 @@ static int ivtv_querycap(struct file *file, void *fh, struct v4l2_capability *vc | |||
762 | { | 767 | { |
763 | struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; | 768 | struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; |
764 | 769 | ||
765 | memset(vcap, 0, sizeof(*vcap)); | ||
766 | strlcpy(vcap->driver, IVTV_DRIVER_NAME, sizeof(vcap->driver)); | 770 | strlcpy(vcap->driver, IVTV_DRIVER_NAME, sizeof(vcap->driver)); |
767 | strlcpy(vcap->card, itv->card_name, sizeof(vcap->card)); | 771 | strlcpy(vcap->card, itv->card_name, sizeof(vcap->card)); |
768 | strlcpy(vcap->bus_info, pci_name(itv->dev), sizeof(vcap->bus_info)); | 772 | strlcpy(vcap->bus_info, pci_name(itv->dev), sizeof(vcap->bus_info)); |
769 | vcap->version = IVTV_DRIVER_VERSION; /* version */ | 773 | vcap->version = IVTV_DRIVER_VERSION; /* version */ |
770 | vcap->capabilities = itv->v4l2_cap; /* capabilities */ | 774 | vcap->capabilities = itv->v4l2_cap; /* capabilities */ |
771 | /* reserved.. must set to 0! */ | ||
772 | vcap->reserved[0] = vcap->reserved[1] = | ||
773 | vcap->reserved[2] = vcap->reserved[3] = 0; | ||
774 | return 0; | 775 | return 0; |
775 | } | 776 | } |
776 | 777 | ||
@@ -1168,7 +1169,6 @@ static int ivtv_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt) | |||
1168 | if (vt->index != 0) | 1169 | if (vt->index != 0) |
1169 | return -EINVAL; | 1170 | return -EINVAL; |
1170 | 1171 | ||
1171 | memset(vt, 0, sizeof(*vt)); | ||
1172 | ivtv_call_i2c_clients(itv, VIDIOC_G_TUNER, vt); | 1172 | ivtv_call_i2c_clients(itv, VIDIOC_G_TUNER, vt); |
1173 | 1173 | ||
1174 | if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags)) { | 1174 | if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags)) { |
@@ -1187,11 +1187,8 @@ static int ivtv_g_sliced_vbi_cap(struct file *file, void *fh, struct v4l2_sliced | |||
1187 | struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; | 1187 | struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; |
1188 | int set = itv->is_50hz ? V4L2_SLICED_VBI_625 : V4L2_SLICED_VBI_525; | 1188 | int set = itv->is_50hz ? V4L2_SLICED_VBI_625 : V4L2_SLICED_VBI_525; |
1189 | int f, l; | 1189 | int f, l; |
1190 | enum v4l2_buf_type type = cap->type; | ||
1191 | 1190 | ||
1192 | memset(cap, 0, sizeof(*cap)); | 1191 | if (cap->type == V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) { |
1193 | cap->type = type; | ||
1194 | if (type == V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) { | ||
1195 | for (f = 0; f < 2; f++) { | 1192 | for (f = 0; f < 2; f++) { |
1196 | for (l = 0; l < 24; l++) { | 1193 | for (l = 0; l < 24; l++) { |
1197 | if (valid_service_line(f, l, itv->is_50hz)) | 1194 | if (valid_service_line(f, l, itv->is_50hz)) |
@@ -1200,7 +1197,7 @@ static int ivtv_g_sliced_vbi_cap(struct file *file, void *fh, struct v4l2_sliced | |||
1200 | } | 1197 | } |
1201 | return 0; | 1198 | return 0; |
1202 | } | 1199 | } |
1203 | if (type == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT) { | 1200 | if (cap->type == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT) { |
1204 | if (!(itv->v4l2_cap & V4L2_CAP_SLICED_VBI_OUTPUT)) | 1201 | if (!(itv->v4l2_cap & V4L2_CAP_SLICED_VBI_OUTPUT)) |
1205 | return -EINVAL; | 1202 | return -EINVAL; |
1206 | if (itv->is_60hz) { | 1203 | if (itv->is_60hz) { |
@@ -1243,7 +1240,6 @@ static int ivtv_encoder_cmd(struct file *file, void *fh, struct v4l2_encoder_cmd | |||
1243 | struct ivtv_open_id *id = fh; | 1240 | struct ivtv_open_id *id = fh; |
1244 | struct ivtv *itv = id->itv; | 1241 | struct ivtv *itv = id->itv; |
1245 | 1242 | ||
1246 | memset(&enc->raw, 0, sizeof(enc->raw)); | ||
1247 | 1243 | ||
1248 | switch (enc->cmd) { | 1244 | switch (enc->cmd) { |
1249 | case V4L2_ENC_CMD_START: | 1245 | case V4L2_ENC_CMD_START: |
@@ -1295,8 +1291,6 @@ static int ivtv_try_encoder_cmd(struct file *file, void *fh, struct v4l2_encoder | |||
1295 | { | 1291 | { |
1296 | struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; | 1292 | struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; |
1297 | 1293 | ||
1298 | memset(&enc->raw, 0, sizeof(enc->raw)); | ||
1299 | |||
1300 | switch (enc->cmd) { | 1294 | switch (enc->cmd) { |
1301 | case V4L2_ENC_CMD_START: | 1295 | case V4L2_ENC_CMD_START: |
1302 | IVTV_DEBUG_IOCTL("V4L2_ENC_CMD_START\n"); | 1296 | IVTV_DEBUG_IOCTL("V4L2_ENC_CMD_START\n"); |
@@ -1349,8 +1343,6 @@ static int ivtv_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb) | |||
1349 | 0, | 1343 | 0, |
1350 | }; | 1344 | }; |
1351 | 1345 | ||
1352 | memset(fb, 0, sizeof(*fb)); | ||
1353 | |||
1354 | if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) | 1346 | if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) |
1355 | return -EINVAL; | 1347 | return -EINVAL; |
1356 | 1348 | ||