From 473d80247332b818caf6d25ed3eaaa10d3dfcfb7 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Thu, 5 Aug 2010 17:22:44 -0300 Subject: V4L/DVB: drivers/media/video: Adjust confusing if indentation In cx23885/cx23885-video.c, cx88/cx88-video.c, davinci/vpif_capture.c, and davinci/vpif_display.c, group the aligned code into a single if branch. In saa7134/saa7134-video.c, outdent the code following the if. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r disable braces4@ position p1,p2; statement S1,S2; @@ ( if (...) { ... } | if (...) S1@p1 S2@p2 ) @script:python@ p1 << r.p1; p2 << r.p2; @@ if (p1[0].column == p2[0].column): cocci.print_main("branch",p1) cocci.print_secs("after",p2) // Signed-off-by: Julia Lawall Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/davinci/vpif_capture.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/media/video/davinci/vpif_capture.c') diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c index a7f48b53d3fc..2b424731f133 100644 --- a/drivers/media/video/davinci/vpif_capture.c +++ b/drivers/media/video/davinci/vpif_capture.c @@ -1030,9 +1030,10 @@ static int vpif_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf) goto qbuf_exit; if ((VIDEOBUF_NEEDS_INIT != buf1->state) - && (buf1->baddr != tbuf.m.userptr)) + && (buf1->baddr != tbuf.m.userptr)) { vpif_buffer_release(&common->buffer_queue, buf1); buf1->baddr = tbuf.m.userptr; + } break; default: -- cgit v1.2.3 From ffa1b391c61b9f9a2b5d14859bfdd9259fc6c4da Mon Sep 17 00:00:00 2001 From: Mats Randgaard Date: Mon, 30 Aug 2010 10:30:36 -0300 Subject: V4L/DVB: vpif_cap/disp: Removed section mismatch warning Signed-off-by: Mats Randgaard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/davinci/vpif_capture.c | 2 +- drivers/media/video/davinci/vpif_display.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/video/davinci/vpif_capture.c') diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c index 2b424731f133..9ba7ace33d4a 100644 --- a/drivers/media/video/davinci/vpif_capture.c +++ b/drivers/media/video/davinci/vpif_capture.c @@ -2114,7 +2114,7 @@ static const struct dev_pm_ops vpif_dev_pm_ops = { .resume = vpif_resume, }; -static struct platform_driver vpif_driver = { +static __refdata struct platform_driver vpif_driver = { .driver = { .name = "vpif_capture", .owner = THIS_MODULE, diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c index 4770fda3a199..a41f188535b3 100644 --- a/drivers/media/video/davinci/vpif_display.c +++ b/drivers/media/video/davinci/vpif_display.c @@ -1611,7 +1611,7 @@ static int vpif_remove(struct platform_device *device) return 0; } -static struct platform_driver vpif_driver = { +static __refdata struct platform_driver vpif_driver = { .driver = { .name = "vpif_display", .owner = THIS_MODULE, -- cgit v1.2.3 From 1f8766b4e3f06c2206e7ff48da72d2886672759a Mon Sep 17 00:00:00 2001 From: Mats Randgaard Date: Mon, 30 Aug 2010 10:30:37 -0300 Subject: V4L/DVB: vpif_cap/disp: Replaced kmalloc with kzalloc Signed-off-by: Mats Randgaard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/davinci/vpif_capture.c | 4 ++-- drivers/media/video/davinci/vpif_display.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/media/video/davinci/vpif_capture.c') diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c index 9ba7ace33d4a..2ed233f98a9e 100644 --- a/drivers/media/video/davinci/vpif_capture.c +++ b/drivers/media/video/davinci/vpif_capture.c @@ -793,7 +793,7 @@ static int vpif_open(struct file *filep) } /* Allocate memory for the file handle object */ - fh = kmalloc(sizeof(struct vpif_fh), GFP_KERNEL); + fh = kzalloc(sizeof(struct vpif_fh), GFP_KERNEL); if (NULL == fh) { vpif_err("unable to allocate memory for file handle object\n"); ret = -ENOMEM; @@ -1995,7 +1995,7 @@ static __init int vpif_probe(struct platform_device *pdev) config = pdev->dev.platform_data; subdev_count = config->subdev_count; - vpif_obj.sd = kmalloc(sizeof(struct v4l2_subdev *) * subdev_count, + vpif_obj.sd = kzalloc(sizeof(struct v4l2_subdev *) * subdev_count, GFP_KERNEL); if (vpif_obj.sd == NULL) { vpif_err("unable to allocate memory for subdevice pointers\n"); diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c index a41f188535b3..912c27b75099 100644 --- a/drivers/media/video/davinci/vpif_display.c +++ b/drivers/media/video/davinci/vpif_display.c @@ -600,7 +600,7 @@ static int vpif_open(struct file *filep) ch = video_get_drvdata(vdev); /* Allocate memory for the file handle object */ - fh = kmalloc(sizeof(struct vpif_fh), GFP_KERNEL); + fh = kzalloc(sizeof(struct vpif_fh), GFP_KERNEL); if (fh == NULL) { vpif_err("unable to allocate memory for file handle object\n"); return -ENOMEM; @@ -1396,7 +1396,7 @@ static int initialize_vpif(void) /* Allocate memory for six channel objects */ for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++) { vpif_obj.dev[i] = - kmalloc(sizeof(struct channel_obj), GFP_KERNEL); + kzalloc(sizeof(struct channel_obj), GFP_KERNEL); /* If memory allocation fails, return error */ if (!vpif_obj.dev[i]) { free_channel_objects_index = i; @@ -1542,7 +1542,7 @@ static __init int vpif_probe(struct platform_device *pdev) config = pdev->dev.platform_data; subdev_count = config->subdev_count; subdevdata = config->subdevinfo; - vpif_obj.sd = kmalloc(sizeof(struct v4l2_subdev *) * subdev_count, + vpif_obj.sd = kzalloc(sizeof(struct v4l2_subdev *) * subdev_count, GFP_KERNEL); if (vpif_obj.sd == NULL) { vpif_err("unable to allocate memory for subdevice pointers\n"); -- cgit v1.2.3 From 11382f3d8a2d54d1db0aa6a768cd94214536c1b2 Mon Sep 17 00:00:00 2001 From: Mats Randgaard Date: Tue, 7 Sep 2010 11:28:23 -0300 Subject: V4L/DVB: vpif_cap: don't ignore return code of videobuf_poll_stream() Signed-off-by: Mats Randgaard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/davinci/vpif_capture.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/media/video/davinci/vpif_capture.c') diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c index 2ed233f98a9e..730bd4cf5772 100644 --- a/drivers/media/video/davinci/vpif_capture.c +++ b/drivers/media/video/davinci/vpif_capture.c @@ -731,7 +731,6 @@ static int vpif_mmap(struct file *filep, struct vm_area_struct *vma) */ static unsigned int vpif_poll(struct file *filep, poll_table * wait) { - int err = 0; struct vpif_fh *fh = filep->private_data; struct channel_obj *channel = fh->channel; struct common_obj *common = &(channel->common[VPIF_VIDEO_INDEX]); @@ -739,8 +738,7 @@ static unsigned int vpif_poll(struct file *filep, poll_table * wait) vpif_dbg(2, debug, "vpif_poll\n"); if (common->started) - err = videobuf_poll_stream(filep, &common->buffer_queue, wait); - + return videobuf_poll_stream(filep, &common->buffer_queue, wait); return 0; } -- cgit v1.2.3 From e3cfd447d01cf723ccda0ad6bfa2e85b73d3d747 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Thu, 30 Sep 2010 09:18:52 -0300 Subject: V4L/DVB: videobuf: add ext_lock argument to the queue init functions (part 2) Missed a few init functions on non-Intel platforms the first time :-( Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/davinci/vpfe_capture.c | 2 +- drivers/media/video/davinci/vpif_capture.c | 3 ++- drivers/media/video/davinci/vpif_display.c | 3 ++- drivers/media/video/fsl-viu.c | 2 +- drivers/media/video/mx1_camera.c | 2 +- drivers/media/video/mx2_camera.c | 2 +- drivers/media/video/mx3_camera.c | 3 ++- drivers/media/video/omap/omap_vout.c | 2 +- drivers/media/video/omap24xxcam.c | 2 +- drivers/media/video/pxa_camera.c | 2 +- drivers/media/video/s5p-fimc/fimc-core.c | 2 +- drivers/media/video/sh_mobile_ceu_camera.c | 2 +- drivers/media/video/sh_vou.c | 3 ++- 13 files changed, 17 insertions(+), 13 deletions(-) (limited to 'drivers/media/video/davinci/vpif_capture.c') diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c index b39112517dfb..cd068de9fc20 100644 --- a/drivers/media/video/davinci/vpfe_capture.c +++ b/drivers/media/video/davinci/vpfe_capture.c @@ -1372,7 +1372,7 @@ static int vpfe_reqbufs(struct file *file, void *priv, req_buf->type, vpfe_dev->fmt.fmt.pix.field, sizeof(struct videobuf_buffer), - fh); + fh, NULL); fh->io_allowed = 1; vpfe_dev->io_usrs = 1; diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c index 730bd4cf5772..109ab8d0ce09 100644 --- a/drivers/media/video/davinci/vpif_capture.c +++ b/drivers/media/video/davinci/vpif_capture.c @@ -927,7 +927,8 @@ static int vpif_reqbufs(struct file *file, void *priv, &common->irqlock, reqbuf->type, common->fmt.fmt.pix.field, - sizeof(struct videobuf_buffer), fh); + sizeof(struct videobuf_buffer), fh, + NULL); /* Set io allowed member of file handle to TRUE */ fh->io_allowed[index] = 1; diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c index 912c27b75099..8894af24bdb2 100644 --- a/drivers/media/video/davinci/vpif_display.c +++ b/drivers/media/video/davinci/vpif_display.c @@ -853,7 +853,8 @@ static int vpif_reqbufs(struct file *file, void *priv, &video_qops, NULL, &common->irqlock, reqbuf->type, field, - sizeof(struct videobuf_buffer), fh); + sizeof(struct videobuf_buffer), fh, + NULL); /* Set io allowed member of file handle to TRUE */ fh->io_allowed[index] = 1; diff --git a/drivers/media/video/fsl-viu.c b/drivers/media/video/fsl-viu.c index 211e83963a46..5c57babdac99 100644 --- a/drivers/media/video/fsl-viu.c +++ b/drivers/media/video/fsl-viu.c @@ -1288,7 +1288,7 @@ static int viu_open(struct file *file) videobuf_queue_dma_contig_init(&fh->vb_vidq, &viu_video_qops, dev->dev, &fh->vbq_lock, fh->type, V4L2_FIELD_INTERLACED, - sizeof(struct viu_buf), fh); + sizeof(struct viu_buf), fh, NULL); return 0; } diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c index adc72c4a9f08..5e486a88ad7c 100644 --- a/drivers/media/video/mx1_camera.c +++ b/drivers/media/video/mx1_camera.c @@ -385,7 +385,7 @@ static void mx1_camera_init_videobuf(struct videobuf_queue *q, &pcdev->lock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE, - sizeof(struct mx1_buffer), icd); + sizeof(struct mx1_buffer), icd, NULL); } static int mclk_get_divisor(struct mx1_camera_dev *pcdev) diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c index e330a76b004a..4a27862da30d 100644 --- a/drivers/media/video/mx2_camera.c +++ b/drivers/media/video/mx2_camera.c @@ -682,7 +682,7 @@ static void mx2_camera_init_videobuf(struct videobuf_queue *q, videobuf_queue_dma_contig_init(q, &mx2_videobuf_ops, pcdev->dev, &pcdev->lock, V4L2_BUF_TYPE_VIDEO_CAPTURE, - V4L2_FIELD_NONE, sizeof(struct mx2_buffer), icd); + V4L2_FIELD_NONE, sizeof(struct mx2_buffer), icd, NULL); } #define MX2_BUS_FLAGS (SOCAM_DATAWIDTH_8 | \ diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c index d020388d29ca..29c5fc348133 100644 --- a/drivers/media/video/mx3_camera.c +++ b/drivers/media/video/mx3_camera.c @@ -441,7 +441,8 @@ static void mx3_camera_init_videobuf(struct videobuf_queue *q, &mx3_cam->lock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE, - sizeof(struct mx3_camera_buffer), icd); + sizeof(struct mx3_camera_buffer), icd, + NULL); } /* First part of ipu_csi_init_interface() */ diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c index 4ed51b1552e1..15f8793e325b 100644 --- a/drivers/media/video/omap/omap_vout.c +++ b/drivers/media/video/omap/omap_vout.c @@ -1341,7 +1341,7 @@ static int omap_vout_open(struct file *file) videobuf_queue_dma_contig_init(q, &video_vbq_ops, q->dev, &vout->vbq_lock, vout->type, V4L2_FIELD_NONE, - sizeof(struct videobuf_buffer), vout); + sizeof(struct videobuf_buffer), vout, NULL); v4l2_dbg(1, debug, &vout->vid_dev->v4l2_dev, "Exiting %s\n", __func__); return 0; diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c index 13c09f5fa875..378b094aff16 100644 --- a/drivers/media/video/omap24xxcam.c +++ b/drivers/media/video/omap24xxcam.c @@ -1491,7 +1491,7 @@ static int omap24xxcam_open(struct file *file) videobuf_queue_sg_init(&fh->vbq, &omap24xxcam_vbq_ops, NULL, &fh->vbq_lock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE, - sizeof(struct videobuf_buffer), fh); + sizeof(struct videobuf_buffer), fh, NULL); return 0; diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c index 7ffa525019d4..c143ed0a5270 100644 --- a/drivers/media/video/pxa_camera.c +++ b/drivers/media/video/pxa_camera.c @@ -852,7 +852,7 @@ static void pxa_camera_init_videobuf(struct videobuf_queue *q, */ videobuf_queue_sg_init(q, &pxa_videobuf_ops, NULL, &pcdev->lock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE, - sizeof(struct pxa_buffer), icd); + sizeof(struct pxa_buffer), icd, NULL); } static u32 mclk_get_divisor(struct platform_device *pdev, diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c index 6961c55baf9b..c56029ee6e31 100644 --- a/drivers/media/video/s5p-fimc/fimc-core.c +++ b/drivers/media/video/s5p-fimc/fimc-core.c @@ -1138,7 +1138,7 @@ static void queue_init(void *priv, struct videobuf_queue *vq, videobuf_queue_dma_contig_init(vq, &fimc_qops, fimc->m2m.v4l2_dev.dev, &fimc->irqlock, type, V4L2_FIELD_NONE, - sizeof(struct fimc_vid_buffer), priv); + sizeof(struct fimc_vid_buffer), priv, NULL); } static int fimc_m2m_open(struct file *file) diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index cbc997d591bf..b11e74949e4c 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c @@ -1786,7 +1786,7 @@ static void sh_mobile_ceu_init_videobuf(struct videobuf_queue *q, V4L2_BUF_TYPE_VIDEO_CAPTURE, pcdev->field, sizeof(struct sh_mobile_ceu_buffer), - icd); + icd, NULL); } static int sh_mobile_ceu_get_parm(struct soc_camera_device *icd, diff --git a/drivers/media/video/sh_vou.c b/drivers/media/video/sh_vou.c index d3acd02a1632..195ac8651160 100644 --- a/drivers/media/video/sh_vou.c +++ b/drivers/media/video/sh_vou.c @@ -1189,7 +1189,8 @@ static int sh_vou_open(struct file *file) vou_dev->v4l2_dev.dev, &vou_dev->lock, V4L2_BUF_TYPE_VIDEO_OUTPUT, V4L2_FIELD_NONE, - sizeof(struct videobuf_buffer), vdev); + sizeof(struct videobuf_buffer), vdev, + NULL); return 0; } -- cgit v1.2.3 From dfffec67951494a02244b43b0b2cdc9cded841b2 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 24 Sep 2010 09:32:10 -0300 Subject: [media] vpif_capture: Don't use module names to load I2C modules With the v4l2_i2c_new_subdev* functions now supporting loading modules based on modaliases, don't use the module names hardcoded in platform data by passing a NULL module name to those functions. The only platform using the VPIF capture device (DM646x EVM) hardcodes the module names to invalid values (tvp514x-0 and tvp514x-1). As this is already broken, there's no risk of breaking it more. Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/davinci/vpif_capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/video/davinci/vpif_capture.c') diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c index 109ab8d0ce09..6ac6acd16352 100644 --- a/drivers/media/video/davinci/vpif_capture.c +++ b/drivers/media/video/davinci/vpif_capture.c @@ -2013,7 +2013,7 @@ static __init int vpif_probe(struct platform_device *pdev) vpif_obj.sd[i] = v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev, i2c_adap, - subdevdata->name, + NULL, &subdevdata->board_info, NULL); -- cgit v1.2.3