aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2009-03-03 23:21:03 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:06 -0400
commit1a1500179a7c51c7851e18c56e7153c258fe91ab (patch)
tree4d87edfc0687cd4de8d4eefc0c46948b1846e129
parentc6a976e44ec37b93cbd62403971e9770ac60d389 (diff)
V4L/DVB (10820): meye: 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 querycap, enum_input, enum_fmt_vid_cap, and g_fmt_vid_cap. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/meye.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c
index 163fb2b329df..d9d73d888aa0 100644
--- a/drivers/media/video/meye.c
+++ b/drivers/media/video/meye.c
@@ -1017,7 +1017,6 @@ static int meyeioc_stilljcapt(int *len)
1017static int vidioc_querycap(struct file *file, void *fh, 1017static int vidioc_querycap(struct file *file, void *fh,
1018 struct v4l2_capability *cap) 1018 struct v4l2_capability *cap)
1019{ 1019{
1020 memset(cap, 0, sizeof(*cap));
1021 strcpy(cap->driver, "meye"); 1020 strcpy(cap->driver, "meye");
1022 strcpy(cap->card, "meye"); 1021 strcpy(cap->card, "meye");
1023 sprintf(cap->bus_info, "PCI:%s", pci_name(meye.mchip_dev)); 1022 sprintf(cap->bus_info, "PCI:%s", pci_name(meye.mchip_dev));
@@ -1036,8 +1035,6 @@ static int vidioc_enum_input(struct file *file, void *fh, struct v4l2_input *i)
1036 if (i->index != 0) 1035 if (i->index != 0)
1037 return -EINVAL; 1036 return -EINVAL;
1038 1037
1039 memset(i, 0, sizeof(*i));
1040 i->index = 0;
1041 strcpy(i->name, "Camera"); 1038 strcpy(i->name, "Camera");
1042 i->type = V4L2_INPUT_TYPE_CAMERA; 1039 i->type = V4L2_INPUT_TYPE_CAMERA;
1043 1040
@@ -1264,16 +1261,12 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh,
1264 1261
1265 if (f->index == 0) { 1262 if (f->index == 0) {
1266 /* standard YUV 422 capture */ 1263 /* standard YUV 422 capture */
1267 memset(f, 0, sizeof(*f));
1268 f->index = 0;
1269 f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1264 f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1270 f->flags = 0; 1265 f->flags = 0;
1271 strcpy(f->description, "YUV422"); 1266 strcpy(f->description, "YUV422");
1272 f->pixelformat = V4L2_PIX_FMT_YUYV; 1267 f->pixelformat = V4L2_PIX_FMT_YUYV;
1273 } else { 1268 } else {
1274 /* compressed MJPEG capture */ 1269 /* compressed MJPEG capture */
1275 memset(f, 0, sizeof(*f));
1276 f->index = 1;
1277 f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1270 f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1278 f->flags = V4L2_FMT_FLAG_COMPRESSED; 1271 f->flags = V4L2_FMT_FLAG_COMPRESSED;
1279 strcpy(f->description, "MJPEG"); 1272 strcpy(f->description, "MJPEG");
@@ -1322,9 +1315,6 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *fh,
1322 if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) 1315 if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
1323 return -EINVAL; 1316 return -EINVAL;
1324 1317
1325 memset(&f->fmt.pix, 0, sizeof(struct v4l2_pix_format));
1326 f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1327
1328 switch (meye.mchip_mode) { 1318 switch (meye.mchip_mode) {
1329 case MCHIP_HIC_MODE_CONT_OUT: 1319 case MCHIP_HIC_MODE_CONT_OUT:
1330 default: 1320 default:
@@ -1341,8 +1331,6 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *fh,
1341 f->fmt.pix.bytesperline = f->fmt.pix.width * 2; 1331 f->fmt.pix.bytesperline = f->fmt.pix.width * 2;
1342 f->fmt.pix.sizeimage = f->fmt.pix.height * 1332 f->fmt.pix.sizeimage = f->fmt.pix.height *
1343 f->fmt.pix.bytesperline; 1333 f->fmt.pix.bytesperline;
1344 f->fmt.pix.colorspace = 0;
1345 f->fmt.pix.priv = 0;
1346 1334
1347 return 0; 1335 return 0;
1348} 1336}