* [PATCH] media: platform: constify vb2_ops structures
@ 2017-01-21 9:29 Bhumika Goyal
2017-01-25 10:08 ` Lad, Prabhakar
0 siblings, 1 reply; 7+ messages in thread
From: Bhumika Goyal @ 2017-01-21 9:29 UTC (permalink / raw)
To: julia.lawall, prabhakar.csengg, mchehab, minghsiu.tsai,
houlong.wei, andrew-ct.chen, matthias.bgg, linux-media,
linux-kernel, linux-arm-kernel, linux-mediatek
Cc: Bhumika Goyal
Declare vb2_ops structures as const as they are only stored in
the ops field of a vb2_queue structure. This field is of type
const, so vb2_ops structures having same properties can be made
const too.
Done using Coccinelle:
@r1 disable optional_qualifier@
identifier i;
position p;
@@
static struct vb2_ops i@p={...};
@ok1@
identifier r1.i;
position p;
struct sta2x11_vip vip;
struct vb2_queue q;
@@
(
vip.vb_vidq.ops=&i@p
|
q.ops=&i@p
)
@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct vb2_ops i;
Cross compiled the media/platform/blackfin/bfin_capture.o file for
blackfin architecture.
File size before:
text data bss dec hex filename
6776 176 0 6952 1b28 platform/blackfin/bfin_capture.o
File size after:
text data bss dec hex filename
6816 136 0 6952 1b28 platform/blackfin/bfin_capture.o
File size before:
text data bss dec hex filename
12852 456 272 13580 350c platform/davinci/vpif_capture.o
File size after:
text data bss dec hex filename
12932 360 272 13564 34fc platform/davinci/vpif_capture.o
File size before:
text data bss dec hex filename
12285 360 276 12921 3279 platform/davinci/vpif_display.o
File size after:
text data bss dec hex filename
12365 296 276 12937 3289 platform/davinci/vpif_display.o
File size details before and after applying the patch remains the same for
drivers/media/platform/pxa_camera.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
drivers/media/platform/davinci/vpif_capture.c | 2 +-
drivers/media/platform/davinci/vpif_display.c | 2 +-
drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 2 +-
drivers/media/platform/pxa_camera.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index f791f5c..54c54d9 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -309,7 +309,7 @@ static void vpif_stop_streaming(struct vb2_queue *vq)
spin_unlock_irqrestore(&common->irqlock, flags);
}
-static struct vb2_ops video_qops = {
+static const struct vb2_ops video_qops = {
.queue_setup = vpif_buffer_queue_setup,
.buf_prepare = vpif_buffer_prepare,
.start_streaming = vpif_start_streaming,
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index e5f1844..9604afd 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -289,7 +289,7 @@ static void vpif_stop_streaming(struct vb2_queue *vq)
spin_unlock_irqrestore(&common->irqlock, flags);
}
-static struct vb2_ops video_qops = {
+static const struct vb2_ops video_qops = {
.queue_setup = vpif_buffer_queue_setup,
.wait_prepare = vb2_ops_wait_prepare,
.wait_finish = vb2_ops_wait_finish,
diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
index 13afe48..3038d62 100644
--- a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
+++ b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
@@ -621,7 +621,7 @@ static void mtk_mdp_m2m_buf_queue(struct vb2_buffer *vb)
v4l2_m2m_buf_queue(ctx->m2m_ctx, to_vb2_v4l2_buffer(vb));
}
-static struct vb2_ops mtk_mdp_m2m_qops = {
+static const struct vb2_ops mtk_mdp_m2m_qops = {
.queue_setup = mtk_mdp_m2m_queue_setup,
.buf_prepare = mtk_mdp_m2m_buf_prepare,
.buf_queue = mtk_mdp_m2m_buf_queue,
diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c
index 929006f..17167d1 100644
--- a/drivers/media/platform/pxa_camera.c
+++ b/drivers/media/platform/pxa_camera.c
@@ -1530,7 +1530,7 @@ static void pxac_vb2_stop_streaming(struct vb2_queue *vq)
pxa_camera_wakeup(pcdev, buf, VB2_BUF_STATE_ERROR);
}
-static struct vb2_ops pxac_vb2_ops = {
+static const struct vb2_ops pxac_vb2_ops = {
.queue_setup = pxac_vb2_queue_setup,
.buf_init = pxac_vb2_init,
.buf_prepare = pxac_vb2_prepare,
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] media: platform: constify vb2_ops structures
2017-01-21 9:29 [PATCH] media: platform: constify vb2_ops structures Bhumika Goyal
@ 2017-01-25 10:08 ` Lad, Prabhakar
0 siblings, 0 replies; 7+ messages in thread
From: Lad, Prabhakar @ 2017-01-25 10:08 UTC (permalink / raw)
To: Bhumika Goyal
Cc: Julia Lawall, Mauro Carvalho Chehab, minghsiu.tsai, houlong.wei,
andrew-ct.chen, matthias.bgg, linux-media, LKML, LAK,
linux-mediatek
Hi,
Thanks for the patch.
On Sat, Jan 21, 2017 at 9:29 AM, Bhumika Goyal <bhumirks@gmail.com> wrote:
> Declare vb2_ops structures as const as they are only stored in
> the ops field of a vb2_queue structure. This field is of type
> const, so vb2_ops structures having same properties can be made
> const too.
> Done using Coccinelle:
>
> @r1 disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct vb2_ops i@p={...};
>
> @ok1@
> identifier r1.i;
> position p;
> struct sta2x11_vip vip;
> struct vb2_queue q;
> @@
> (
> vip.vb_vidq.ops=&i@p
> |
> q.ops=&i@p
> )
>
> @bad@
> position p!={r1.p,ok1.p};
> identifier r1.i;
> @@
> i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r1.i;
> @@
> +const
> struct vb2_ops i;
>
> Cross compiled the media/platform/blackfin/bfin_capture.o file for
> blackfin architecture.
>
> File size before:
> text data bss dec hex filename
> 6776 176 0 6952 1b28 platform/blackfin/bfin_capture.o
>
The description doesnt match the changes. Can you please split the
patches separately one for vpif_capture.c and vpif_display.c,
one for mtk_mdp_m2m.c and lastly for pxa_camera.c .
Cheers,
--Prabhakar Lad
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [media] platform: constify vb2_ops structures
2016-09-08 23:59 [PATCH] [media] " Julia Lawall
` (2 preceding siblings ...)
2016-09-09 9:48 ` Jacek Anaszewski
@ 2016-09-09 16:03 ` Benoit Parrot
3 siblings, 0 replies; 7+ messages in thread
From: Benoit Parrot @ 2016-09-09 16:03 UTC (permalink / raw)
To: Julia Lawall
Cc: Sylwester Nawrocki, kernel-janitors, Fabien Dessenne,
linux-samsung-soc, Krzysztof Kozlowski, Kukjin Kim,
Andrzej Hajda, Kamil Debski, Kyungmin Park,
Guennadi Liakhovetski, Ludovic Desroches, Hyun Kwon,
Laurent Pinchart, Mauro Carvalho Chehab, Michal Simek,
Sören Brinkmann, linux-media, linux-arm-kernel,
linux-kernel, Andrzej Pietrasiewicz, Jacek Anaszewski,
Mikhail Ulyanov, Matthias Brugger, linux-mediatek
Hi,
Thanks for the patch.
Julia Lawall <Julia.Lawall@lip6.fr> wrote on Fri [2016-Sep-09 01:59:10 +0200]:
> Check for vb2_ops structures that are only stored in the ops field of a
> vb2_queue structure. That field is declared const, so vb2_ops structures
> that have this property can be declared as const also.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct vb2_ops i@p = { ... };
>
> @ok@
> identifier r.i;
> struct vb2_queue e;
> position p;
> @@
> e.ops = &i@p;
>
> @bad@
> position p != {r.p,ok.p};
> identifier r.i;
> struct vb2_ops e;
> @@
> e@i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
> struct vb2_ops i = { ... };
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
> drivers/media/platform/exynos-gsc/gsc-m2m.c | 2 +-
> drivers/media/platform/exynos4-is/fimc-capture.c | 2 +-
> drivers/media/platform/exynos4-is/fimc-m2m.c | 2 +-
> drivers/media/platform/m2m-deinterlace.c | 2 +-
> drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 2 +-
> drivers/media/platform/mx2_emmaprp.c | 2 +-
> drivers/media/platform/rcar-vin/rcar-dma.c | 2 +-
> drivers/media/platform/rcar_jpu.c | 2 +-
> drivers/media/platform/s5p-g2d/g2d.c | 2 +-
> drivers/media/platform/s5p-jpeg/jpeg-core.c | 2 +-
> drivers/media/platform/sh_vou.c | 2 +-
> drivers/media/platform/soc_camera/atmel-isi.c | 2 +-
> drivers/media/platform/soc_camera/rcar_vin.c | 2 +-
> drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c | 2 +-
> drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 2 +-
For the following 2 drivers,
> drivers/media/platform/ti-vpe/cal.c | 2 +-
> drivers/media/platform/ti-vpe/vpe.c | 2 +-
Reviewed-by: Benoit Parrot <bparrot@ti.com>
> drivers/media/platform/vim2m.c | 2 +-
> drivers/media/platform/xilinx/xilinx-dma.c | 2 +-
> 19 files changed, 19 insertions(+), 19 deletions(-)
Regards,
Benoit Parrot
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [media] platform: constify vb2_ops structures
2016-09-08 23:59 [PATCH] [media] " Julia Lawall
2016-09-09 8:42 ` Laurent Pinchart
2016-09-09 8:53 ` Fabien DESSENNE
@ 2016-09-09 9:48 ` Jacek Anaszewski
2016-09-09 16:03 ` Benoit Parrot
3 siblings, 0 replies; 7+ messages in thread
From: Jacek Anaszewski @ 2016-09-09 9:48 UTC (permalink / raw)
To: Julia Lawall, Sylwester Nawrocki
Cc: kernel-janitors, Fabien Dessenne, linux-samsung-soc,
Krzysztof Kozlowski, Kukjin Kim, Andrzej Hajda, Kamil Debski,
Kyungmin Park, Benoit Parrot, Guennadi Liakhovetski,
Ludovic Desroches, Hyun Kwon, Laurent Pinchart,
Mauro Carvalho Chehab, Michal Simek, Sören Brinkmann,
linux-media, linux-arm-kernel, linux-kernel,
Andrzej Pietrasiewicz, Mikhail Ulyanov, Matthias Brugger,
linux-mediatek
Hi Julia,
On 09/09/2016 01:59 AM, Julia Lawall wrote:
> Check for vb2_ops structures that are only stored in the ops field of a
> vb2_queue structure. That field is declared const, so vb2_ops structures
> that have this property can be declared as const also.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
[...]
> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> index 785e693..d9c07b8 100644
> --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
> +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> @@ -2538,7 +2538,7 @@ static void s5p_jpeg_stop_streaming(struct vb2_queue *q)
> pm_runtime_put(ctx->jpeg->dev);
> }
>
> -static struct vb2_ops s5p_jpeg_qops = {
> +static const struct vb2_ops s5p_jpeg_qops = {
> .queue_setup = s5p_jpeg_queue_setup,
> .buf_prepare = s5p_jpeg_buf_prepare,
> .buf_queue = s5p_jpeg_buf_queue,
> diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
> index e967fcf..44323cb 100644
> --- a/drivers/media/platform/ti-vpe/cal.c
> +++ b/drivers/media/platform/ti-vpe/cal.c
> @@ -1379,7 +1379,7 @@ static void cal_stop_streaming(struct vb2_queue *vq)
> cal_runtime_put(ctx->dev);
> }
Thanks for the patch.
For s5p-jpeg driver:
Reviewed-by: Jacek Anaszewski <j.anaszewski@samsung.com>
--
Best regards,
Jacek Anaszewski
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [media] platform: constify vb2_ops structures
2016-09-08 23:59 [PATCH] [media] " Julia Lawall
2016-09-09 8:42 ` Laurent Pinchart
@ 2016-09-09 8:53 ` Fabien DESSENNE
2016-09-09 9:48 ` Jacek Anaszewski
2016-09-09 16:03 ` Benoit Parrot
3 siblings, 0 replies; 7+ messages in thread
From: Fabien DESSENNE @ 2016-09-09 8:53 UTC (permalink / raw)
To: Julia Lawall, Sylwester Nawrocki
Cc: kernel-janitors, linux-samsung-soc, Krzysztof Kozlowski,
Kukjin Kim, Andrzej Hajda, Kamil Debski, Kyungmin Park,
Benoit Parrot, Guennadi Liakhovetski, Ludovic Desroches,
Hyun Kwon, Laurent Pinchart, Mauro Carvalho Chehab, Michal Simek,
Sören Brinkmann, linux-media, linux-arm-kernel,
linux-kernel, Andrzej Pietrasiewicz, Jacek Anaszewski,
Mikhail Ulyanov, Matthias Brugger, linux-mediatek
Hi
On 09/09/2016 01:59 AM, Julia Lawall wrote:
> Check for vb2_ops structures that are only stored in the ops field of a
> vb2_queue structure. That field is declared const, so vb2_ops structures
> that have this property can be declared as const also.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct vb2_ops i@p = { ... };
>
> @ok@
> identifier r.i;
> struct vb2_queue e;
> position p;
> @@
> e.ops = &i@p;
>
> @bad@
> position p != {r.p,ok.p};
> identifier r.i;
> struct vb2_ops e;
> @@
> e@i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
> struct vb2_ops i = { ... };
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
> drivers/media/platform/exynos-gsc/gsc-m2m.c | 2 +-
> drivers/media/platform/exynos4-is/fimc-capture.c | 2 +-
> drivers/media/platform/exynos4-is/fimc-m2m.c | 2 +-
> drivers/media/platform/m2m-deinterlace.c | 2 +-
> drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 2 +-
> drivers/media/platform/mx2_emmaprp.c | 2 +-
> drivers/media/platform/rcar-vin/rcar-dma.c | 2 +-
> drivers/media/platform/rcar_jpu.c | 2 +-
> drivers/media/platform/s5p-g2d/g2d.c | 2 +-
> drivers/media/platform/s5p-jpeg/jpeg-core.c | 2 +-
> drivers/media/platform/sh_vou.c | 2 +-
> drivers/media/platform/soc_camera/atmel-isi.c | 2 +-
> drivers/media/platform/soc_camera/rcar_vin.c | 2 +-
> drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c | 2 +-
For this driver:
> drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 2 +-
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>
> drivers/media/platform/ti-vpe/cal.c | 2 +-
> drivers/media/platform/ti-vpe/vpe.c | 2 +-
> drivers/media/platform/vim2m.c | 2 +-
> drivers/media/platform/xilinx/xilinx-dma.c | 2 +-
> 19 files changed, 19 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c
> index 7ae1a13..1d5836c 100644
> --- a/drivers/media/platform/xilinx/xilinx-dma.c
> +++ b/drivers/media/platform/xilinx/xilinx-dma.c
> @@ -474,7 +474,7 @@ static void xvip_dma_stop_streaming(struct vb2_queue *vq)
> spin_unlock_irq(&dma->queued_lock);
> }
>
> -static struct vb2_ops xvip_dma_queue_qops = {
> +static const struct vb2_ops xvip_dma_queue_qops = {
> .queue_setup = xvip_dma_queue_setup,
> .buf_prepare = xvip_dma_buffer_prepare,
> .buf_queue = xvip_dma_buffer_queue,
> diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c
> index 30211f6..46de657 100644
> --- a/drivers/media/platform/soc_camera/atmel-isi.c
> +++ b/drivers/media/platform/soc_camera/atmel-isi.c
> @@ -536,7 +536,7 @@ static void stop_streaming(struct vb2_queue *vq)
> pm_runtime_put(ici->v4l2_dev.dev);
> }
>
> -static struct vb2_ops isi_video_qops = {
> +static const struct vb2_ops isi_video_qops = {
> .queue_setup = queue_setup,
> .buf_init = buffer_init,
> .buf_prepare = buffer_prepare,
> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> index 785e693..d9c07b8 100644
> --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
> +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> @@ -2538,7 +2538,7 @@ static void s5p_jpeg_stop_streaming(struct vb2_queue *q)
> pm_runtime_put(ctx->jpeg->dev);
> }
>
> -static struct vb2_ops s5p_jpeg_qops = {
> +static const struct vb2_ops s5p_jpeg_qops = {
> .queue_setup = s5p_jpeg_queue_setup,
> .buf_prepare = s5p_jpeg_buf_prepare,
> .buf_queue = s5p_jpeg_buf_queue,
> diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
> index e967fcf..44323cb 100644
> --- a/drivers/media/platform/ti-vpe/cal.c
> +++ b/drivers/media/platform/ti-vpe/cal.c
> @@ -1379,7 +1379,7 @@ static void cal_stop_streaming(struct vb2_queue *vq)
> cal_runtime_put(ctx->dev);
> }
>
> -static struct vb2_ops cal_video_qops = {
> +static const struct vb2_ops cal_video_qops = {
> .queue_setup = cal_queue_setup,
> .buf_prepare = cal_buffer_prepare,
> .buf_queue = cal_buffer_queue,
> diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
> index 55a1458..0189f7f 100644
> --- a/drivers/media/platform/ti-vpe/vpe.c
> +++ b/drivers/media/platform/ti-vpe/vpe.c
> @@ -1878,7 +1878,7 @@ static void vpe_stop_streaming(struct vb2_queue *q)
> vpdma_dump_regs(ctx->dev->vpdma);
> }
>
> -static struct vb2_ops vpe_qops = {
> +static const struct vb2_ops vpe_qops = {
> .queue_setup = vpe_queue_setup,
> .buf_prepare = vpe_buf_prepare,
> .buf_queue = vpe_buf_queue,
> diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
> index 9c13752..0009fc5 100644
> --- a/drivers/media/platform/soc_camera/rcar_vin.c
> +++ b/drivers/media/platform/soc_camera/rcar_vin.c
> @@ -856,7 +856,7 @@ static void rcar_vin_stop_streaming(struct vb2_queue *vq)
> spin_unlock_irq(&priv->lock);
> }
>
> -static struct vb2_ops rcar_vin_vb2_ops = {
> +static const struct vb2_ops rcar_vin_vb2_ops = {
> .queue_setup = rcar_vin_videobuf_setup,
> .buf_queue = rcar_vin_videobuf_queue,
> .stop_streaming = rcar_vin_stop_streaming,
> diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
> index 02b519d..02c8dc5 100644
> --- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
> +++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
> @@ -470,7 +470,7 @@ static void sh_mobile_ceu_stop_streaming(struct vb2_queue *q)
> sh_mobile_ceu_soft_reset(pcdev);
> }
>
> -static struct vb2_ops sh_mobile_ceu_videobuf_ops = {
> +static const struct vb2_ops sh_mobile_ceu_videobuf_ops = {
> .queue_setup = sh_mobile_ceu_videobuf_setup,
> .buf_prepare = sh_mobile_ceu_videobuf_prepare,
> .buf_queue = sh_mobile_ceu_videobuf_queue,
> diff --git a/drivers/media/platform/s5p-g2d/g2d.c b/drivers/media/platform/s5p-g2d/g2d.c
> index 391dd7a..62c0dec 100644
> --- a/drivers/media/platform/s5p-g2d/g2d.c
> +++ b/drivers/media/platform/s5p-g2d/g2d.c
> @@ -138,7 +138,7 @@ static void g2d_buf_queue(struct vb2_buffer *vb)
> v4l2_m2m_buf_queue(ctx->fh.m2m_ctx, vbuf);
> }
>
> -static struct vb2_ops g2d_qops = {
> +static const struct vb2_ops g2d_qops = {
> .queue_setup = g2d_queue_setup,
> .buf_prepare = g2d_buf_prepare,
> .buf_queue = g2d_buf_queue,
> diff --git a/drivers/media/platform/rcar_jpu.c b/drivers/media/platform/rcar_jpu.c
> index 16782ce..d1746ec 100644
> --- a/drivers/media/platform/rcar_jpu.c
> +++ b/drivers/media/platform/rcar_jpu.c
> @@ -1183,7 +1183,7 @@ static void jpu_stop_streaming(struct vb2_queue *vq)
> }
> }
>
> -static struct vb2_ops jpu_qops = {
> +static const struct vb2_ops jpu_qops = {
> .queue_setup = jpu_queue_setup,
> .buf_prepare = jpu_buf_prepare,
> .buf_queue = jpu_buf_queue,
> diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c
> index ec6494c..a341a7f 100644
> --- a/drivers/media/platform/exynos-gsc/gsc-m2m.c
> +++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c
> @@ -261,7 +261,7 @@ static void gsc_m2m_buf_queue(struct vb2_buffer *vb)
> v4l2_m2m_buf_queue(ctx->m2m_ctx, vbuf);
> }
>
> -static struct vb2_ops gsc_m2m_qops = {
> +static const struct vb2_ops gsc_m2m_qops = {
> .queue_setup = gsc_m2m_queue_setup,
> .buf_prepare = gsc_m2m_buf_prepare,
> .buf_queue = gsc_m2m_buf_queue,
> diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
> index e1f39b4..1ec9a2e 100644
> --- a/drivers/media/platform/sh_vou.c
> +++ b/drivers/media/platform/sh_vou.c
> @@ -362,7 +362,7 @@ static void sh_vou_stop_streaming(struct vb2_queue *vq)
> spin_unlock_irqrestore(&vou_dev->lock, flags);
> }
>
> -static struct vb2_ops sh_vou_qops = {
> +static const struct vb2_ops sh_vou_qops = {
> .queue_setup = sh_vou_queue_setup,
> .buf_prepare = sh_vou_buf_prepare,
> .buf_queue = sh_vou_buf_queue,
> diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
> index 3b1ac68..45f82b5 100644
> --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
> +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
> @@ -527,7 +527,7 @@ static void bdisp_stop_streaming(struct vb2_queue *q)
> pm_runtime_put(ctx->bdisp_dev->dev);
> }
>
> -static struct vb2_ops bdisp_qops = {
> +static const struct vb2_ops bdisp_qops = {
> .queue_setup = bdisp_queue_setup,
> .buf_prepare = bdisp_buf_prepare,
> .buf_queue = bdisp_buf_queue,
> diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c
> index 0fcb5c78..0870fad 100644
> --- a/drivers/media/platform/m2m-deinterlace.c
> +++ b/drivers/media/platform/m2m-deinterlace.c
> @@ -852,7 +852,7 @@ static void deinterlace_buf_queue(struct vb2_buffer *vb)
> v4l2_m2m_buf_queue(ctx->m2m_ctx, vbuf);
> }
>
> -static struct vb2_ops deinterlace_qops = {
> +static const struct vb2_ops deinterlace_qops = {
> .queue_setup = deinterlace_queue_setup,
> .buf_prepare = deinterlace_buf_prepare,
> .buf_queue = deinterlace_buf_queue,
> diff --git a/drivers/media/platform/mx2_emmaprp.c b/drivers/media/platform/mx2_emmaprp.c
> index c639406..e68d271 100644
> --- a/drivers/media/platform/mx2_emmaprp.c
> +++ b/drivers/media/platform/mx2_emmaprp.c
> @@ -743,7 +743,7 @@ static void emmaprp_buf_queue(struct vb2_buffer *vb)
> v4l2_m2m_buf_queue(ctx->m2m_ctx, vbuf);
> }
>
> -static struct vb2_ops emmaprp_qops = {
> +static const struct vb2_ops emmaprp_qops = {
> .queue_setup = emmaprp_queue_setup,
> .buf_prepare = emmaprp_buf_prepare,
> .buf_queue = emmaprp_buf_queue,
> diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c
> index 496aa97..07c07c1 100644
> --- a/drivers/media/platform/rcar-vin/rcar-dma.c
> +++ b/drivers/media/platform/rcar-vin/rcar-dma.c
> @@ -1116,7 +1116,7 @@ static void rvin_stop_streaming(struct vb2_queue *vq)
> rvin_disable_interrupts(vin);
> }
>
> -static struct vb2_ops rvin_qops = {
> +static const struct vb2_ops rvin_qops = {
> .queue_setup = rvin_queue_setup,
> .buf_prepare = rvin_buffer_prepare,
> .buf_queue = rvin_buffer_queue,
> diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
> index cd0ff4a..a98f679 100644
> --- a/drivers/media/platform/vim2m.c
> +++ b/drivers/media/platform/vim2m.c
> @@ -815,7 +815,7 @@ static void vim2m_stop_streaming(struct vb2_queue *q)
> }
> }
>
> -static struct vb2_ops vim2m_qops = {
> +static const struct vb2_ops vim2m_qops = {
> .queue_setup = vim2m_queue_setup,
> .buf_prepare = vim2m_buf_prepare,
> .buf_queue = vim2m_buf_queue,
> diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c
> index fdec499..344028e 100644
> --- a/drivers/media/platform/exynos4-is/fimc-capture.c
> +++ b/drivers/media/platform/exynos4-is/fimc-capture.c
> @@ -452,7 +452,7 @@ static void buffer_queue(struct vb2_buffer *vb)
> spin_unlock_irqrestore(&fimc->slock, flags);
> }
>
> -static struct vb2_ops fimc_capture_qops = {
> +static const struct vb2_ops fimc_capture_qops = {
> .queue_setup = queue_setup,
> .buf_prepare = buffer_prepare,
> .buf_queue = buffer_queue,
> diff --git a/drivers/media/platform/exynos4-is/fimc-m2m.c b/drivers/media/platform/exynos4-is/fimc-m2m.c
> index b1309e1..6028e4f 100644
> --- a/drivers/media/platform/exynos4-is/fimc-m2m.c
> +++ b/drivers/media/platform/exynos4-is/fimc-m2m.c
> @@ -219,7 +219,7 @@ static void fimc_buf_queue(struct vb2_buffer *vb)
> v4l2_m2m_buf_queue(ctx->fh.m2m_ctx, vbuf);
> }
>
> -static struct vb2_ops fimc_qops = {
> +static const struct vb2_ops fimc_qops = {
> .queue_setup = fimc_queue_setup,
> .buf_prepare = fimc_buf_prepare,
> .buf_queue = fimc_buf_queue,
> diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> index 3ed3f2d..f8e4611 100644
> --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> @@ -864,7 +864,7 @@ static void vb2ops_venc_stop_streaming(struct vb2_queue *q)
> ctx->state = MTK_STATE_FREE;
> }
>
> -static struct vb2_ops mtk_venc_vb2_ops = {
> +static const struct vb2_ops mtk_venc_vb2_ops = {
> .queue_setup = vb2ops_venc_queue_setup,
> .buf_prepare = vb2ops_venc_buf_prepare,
> .buf_queue = vb2ops_venc_buf_queue,
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [media] platform: constify vb2_ops structures
2016-09-08 23:59 [PATCH] [media] " Julia Lawall
@ 2016-09-09 8:42 ` Laurent Pinchart
2016-09-09 8:53 ` Fabien DESSENNE
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Laurent Pinchart @ 2016-09-09 8:42 UTC (permalink / raw)
To: Julia Lawall
Cc: Sylwester Nawrocki, kernel-janitors, Fabien Dessenne,
linux-samsung-soc, Krzysztof Kozlowski, Kukjin Kim,
Andrzej Hajda, Kamil Debski, Kyungmin Park, Benoit Parrot,
Guennadi Liakhovetski, Ludovic Desroches, Hyun Kwon,
Mauro Carvalho Chehab, Michal Simek, Sören Brinkmann,
linux-media, linux-arm-kernel, linux-kernel,
Andrzej Pietrasiewicz, Jacek Anaszewski, Mikhail Ulyanov,
Matthias Brugger, linux-mediatek
Hi Julia,
Thank you for the patch.
On Friday 09 Sep 2016 01:59:10 Julia Lawall wrote:
> Check for vb2_ops structures that are only stored in the ops field of a
> vb2_queue structure. That field is declared const, so vb2_ops structures
> that have this property can be declared as const also.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct vb2_ops i@p = { ... };
>
> @ok@
> identifier r.i;
> struct vb2_queue e;
> position p;
> @@
> e.ops = &i@p;
>
> @bad@
> position p != {r.p,ok.p};
> identifier r.i;
> struct vb2_ops e;
> @@
> e@i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
> struct vb2_ops i = { ... };
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
For the drivers below,
> drivers/media/platform/m2m-deinterlace.c | 2 +-
> drivers/media/platform/rcar-vin/rcar-dma.c | 2 +-
> drivers/media/platform/rcar_jpu.c | 2 +-
> drivers/media/platform/sh_vou.c | 2 +-
> drivers/media/platform/soc_camera/atmel-isi.c | 2 +-
> drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c | 2 +-
> drivers/media/platform/vim2m.c | 2 +-
> drivers/media/platform/xilinx/xilinx-dma.c | 2 +-
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
For
> drivers/media/platform/soc_camera/rcar_vin.c | 2 +-
you can also add my
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
tag, but the driver will be scheduled for removal very soon.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] [media] platform: constify vb2_ops structures
@ 2016-09-08 23:59 Julia Lawall
2016-09-09 8:42 ` Laurent Pinchart
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Julia Lawall @ 2016-09-08 23:59 UTC (permalink / raw)
To: Sylwester Nawrocki
Cc: kernel-janitors, Fabien Dessenne, linux-samsung-soc,
Krzysztof Kozlowski, Kukjin Kim, Andrzej Hajda, Kamil Debski,
Kyungmin Park, Benoit Parrot, Guennadi Liakhovetski,
Ludovic Desroches, Hyun Kwon, Laurent Pinchart,
Mauro Carvalho Chehab, Michal Simek, Sören Brinkmann,
linux-media, linux-arm-kernel, linux-kernel,
Andrzej Pietrasiewicz, Jacek Anaszewski, Mikhail Ulyanov,
Matthias Brugger, linux-mediatek
Check for vb2_ops structures that are only stored in the ops field of a
vb2_queue structure. That field is declared const, so vb2_ops structures
that have this property can be declared as const also.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct vb2_ops i@p = { ... };
@ok@
identifier r.i;
struct vb2_queue e;
position p;
@@
e.ops = &i@p;
@bad@
position p != {r.p,ok.p};
identifier r.i;
struct vb2_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct vb2_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/media/platform/exynos-gsc/gsc-m2m.c | 2 +-
drivers/media/platform/exynos4-is/fimc-capture.c | 2 +-
drivers/media/platform/exynos4-is/fimc-m2m.c | 2 +-
drivers/media/platform/m2m-deinterlace.c | 2 +-
drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 2 +-
drivers/media/platform/mx2_emmaprp.c | 2 +-
drivers/media/platform/rcar-vin/rcar-dma.c | 2 +-
drivers/media/platform/rcar_jpu.c | 2 +-
drivers/media/platform/s5p-g2d/g2d.c | 2 +-
drivers/media/platform/s5p-jpeg/jpeg-core.c | 2 +-
drivers/media/platform/sh_vou.c | 2 +-
drivers/media/platform/soc_camera/atmel-isi.c | 2 +-
drivers/media/platform/soc_camera/rcar_vin.c | 2 +-
drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c | 2 +-
drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 2 +-
drivers/media/platform/ti-vpe/cal.c | 2 +-
drivers/media/platform/ti-vpe/vpe.c | 2 +-
drivers/media/platform/vim2m.c | 2 +-
drivers/media/platform/xilinx/xilinx-dma.c | 2 +-
19 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c
index 7ae1a13..1d5836c 100644
--- a/drivers/media/platform/xilinx/xilinx-dma.c
+++ b/drivers/media/platform/xilinx/xilinx-dma.c
@@ -474,7 +474,7 @@ static void xvip_dma_stop_streaming(struct vb2_queue *vq)
spin_unlock_irq(&dma->queued_lock);
}
-static struct vb2_ops xvip_dma_queue_qops = {
+static const struct vb2_ops xvip_dma_queue_qops = {
.queue_setup = xvip_dma_queue_setup,
.buf_prepare = xvip_dma_buffer_prepare,
.buf_queue = xvip_dma_buffer_queue,
diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c
index 30211f6..46de657 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -536,7 +536,7 @@ static void stop_streaming(struct vb2_queue *vq)
pm_runtime_put(ici->v4l2_dev.dev);
}
-static struct vb2_ops isi_video_qops = {
+static const struct vb2_ops isi_video_qops = {
.queue_setup = queue_setup,
.buf_init = buffer_init,
.buf_prepare = buffer_prepare,
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 785e693..d9c07b8 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -2538,7 +2538,7 @@ static void s5p_jpeg_stop_streaming(struct vb2_queue *q)
pm_runtime_put(ctx->jpeg->dev);
}
-static struct vb2_ops s5p_jpeg_qops = {
+static const struct vb2_ops s5p_jpeg_qops = {
.queue_setup = s5p_jpeg_queue_setup,
.buf_prepare = s5p_jpeg_buf_prepare,
.buf_queue = s5p_jpeg_buf_queue,
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index e967fcf..44323cb 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -1379,7 +1379,7 @@ static void cal_stop_streaming(struct vb2_queue *vq)
cal_runtime_put(ctx->dev);
}
-static struct vb2_ops cal_video_qops = {
+static const struct vb2_ops cal_video_qops = {
.queue_setup = cal_queue_setup,
.buf_prepare = cal_buffer_prepare,
.buf_queue = cal_buffer_queue,
diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
index 55a1458..0189f7f 100644
--- a/drivers/media/platform/ti-vpe/vpe.c
+++ b/drivers/media/platform/ti-vpe/vpe.c
@@ -1878,7 +1878,7 @@ static void vpe_stop_streaming(struct vb2_queue *q)
vpdma_dump_regs(ctx->dev->vpdma);
}
-static struct vb2_ops vpe_qops = {
+static const struct vb2_ops vpe_qops = {
.queue_setup = vpe_queue_setup,
.buf_prepare = vpe_buf_prepare,
.buf_queue = vpe_buf_queue,
diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
index 9c13752..0009fc5 100644
--- a/drivers/media/platform/soc_camera/rcar_vin.c
+++ b/drivers/media/platform/soc_camera/rcar_vin.c
@@ -856,7 +856,7 @@ static void rcar_vin_stop_streaming(struct vb2_queue *vq)
spin_unlock_irq(&priv->lock);
}
-static struct vb2_ops rcar_vin_vb2_ops = {
+static const struct vb2_ops rcar_vin_vb2_ops = {
.queue_setup = rcar_vin_videobuf_setup,
.buf_queue = rcar_vin_videobuf_queue,
.stop_streaming = rcar_vin_stop_streaming,
diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
index 02b519d..02c8dc5 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
@@ -470,7 +470,7 @@ static void sh_mobile_ceu_stop_streaming(struct vb2_queue *q)
sh_mobile_ceu_soft_reset(pcdev);
}
-static struct vb2_ops sh_mobile_ceu_videobuf_ops = {
+static const struct vb2_ops sh_mobile_ceu_videobuf_ops = {
.queue_setup = sh_mobile_ceu_videobuf_setup,
.buf_prepare = sh_mobile_ceu_videobuf_prepare,
.buf_queue = sh_mobile_ceu_videobuf_queue,
diff --git a/drivers/media/platform/s5p-g2d/g2d.c b/drivers/media/platform/s5p-g2d/g2d.c
index 391dd7a..62c0dec 100644
--- a/drivers/media/platform/s5p-g2d/g2d.c
+++ b/drivers/media/platform/s5p-g2d/g2d.c
@@ -138,7 +138,7 @@ static void g2d_buf_queue(struct vb2_buffer *vb)
v4l2_m2m_buf_queue(ctx->fh.m2m_ctx, vbuf);
}
-static struct vb2_ops g2d_qops = {
+static const struct vb2_ops g2d_qops = {
.queue_setup = g2d_queue_setup,
.buf_prepare = g2d_buf_prepare,
.buf_queue = g2d_buf_queue,
diff --git a/drivers/media/platform/rcar_jpu.c b/drivers/media/platform/rcar_jpu.c
index 16782ce..d1746ec 100644
--- a/drivers/media/platform/rcar_jpu.c
+++ b/drivers/media/platform/rcar_jpu.c
@@ -1183,7 +1183,7 @@ static void jpu_stop_streaming(struct vb2_queue *vq)
}
}
-static struct vb2_ops jpu_qops = {
+static const struct vb2_ops jpu_qops = {
.queue_setup = jpu_queue_setup,
.buf_prepare = jpu_buf_prepare,
.buf_queue = jpu_buf_queue,
diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c
index ec6494c..a341a7f 100644
--- a/drivers/media/platform/exynos-gsc/gsc-m2m.c
+++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c
@@ -261,7 +261,7 @@ static void gsc_m2m_buf_queue(struct vb2_buffer *vb)
v4l2_m2m_buf_queue(ctx->m2m_ctx, vbuf);
}
-static struct vb2_ops gsc_m2m_qops = {
+static const struct vb2_ops gsc_m2m_qops = {
.queue_setup = gsc_m2m_queue_setup,
.buf_prepare = gsc_m2m_buf_prepare,
.buf_queue = gsc_m2m_buf_queue,
diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
index e1f39b4..1ec9a2e 100644
--- a/drivers/media/platform/sh_vou.c
+++ b/drivers/media/platform/sh_vou.c
@@ -362,7 +362,7 @@ static void sh_vou_stop_streaming(struct vb2_queue *vq)
spin_unlock_irqrestore(&vou_dev->lock, flags);
}
-static struct vb2_ops sh_vou_qops = {
+static const struct vb2_ops sh_vou_qops = {
.queue_setup = sh_vou_queue_setup,
.buf_prepare = sh_vou_buf_prepare,
.buf_queue = sh_vou_buf_queue,
diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
index 3b1ac68..45f82b5 100644
--- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
+++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
@@ -527,7 +527,7 @@ static void bdisp_stop_streaming(struct vb2_queue *q)
pm_runtime_put(ctx->bdisp_dev->dev);
}
-static struct vb2_ops bdisp_qops = {
+static const struct vb2_ops bdisp_qops = {
.queue_setup = bdisp_queue_setup,
.buf_prepare = bdisp_buf_prepare,
.buf_queue = bdisp_buf_queue,
diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c
index 0fcb5c78..0870fad 100644
--- a/drivers/media/platform/m2m-deinterlace.c
+++ b/drivers/media/platform/m2m-deinterlace.c
@@ -852,7 +852,7 @@ static void deinterlace_buf_queue(struct vb2_buffer *vb)
v4l2_m2m_buf_queue(ctx->m2m_ctx, vbuf);
}
-static struct vb2_ops deinterlace_qops = {
+static const struct vb2_ops deinterlace_qops = {
.queue_setup = deinterlace_queue_setup,
.buf_prepare = deinterlace_buf_prepare,
.buf_queue = deinterlace_buf_queue,
diff --git a/drivers/media/platform/mx2_emmaprp.c b/drivers/media/platform/mx2_emmaprp.c
index c639406..e68d271 100644
--- a/drivers/media/platform/mx2_emmaprp.c
+++ b/drivers/media/platform/mx2_emmaprp.c
@@ -743,7 +743,7 @@ static void emmaprp_buf_queue(struct vb2_buffer *vb)
v4l2_m2m_buf_queue(ctx->m2m_ctx, vbuf);
}
-static struct vb2_ops emmaprp_qops = {
+static const struct vb2_ops emmaprp_qops = {
.queue_setup = emmaprp_queue_setup,
.buf_prepare = emmaprp_buf_prepare,
.buf_queue = emmaprp_buf_queue,
diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c
index 496aa97..07c07c1 100644
--- a/drivers/media/platform/rcar-vin/rcar-dma.c
+++ b/drivers/media/platform/rcar-vin/rcar-dma.c
@@ -1116,7 +1116,7 @@ static void rvin_stop_streaming(struct vb2_queue *vq)
rvin_disable_interrupts(vin);
}
-static struct vb2_ops rvin_qops = {
+static const struct vb2_ops rvin_qops = {
.queue_setup = rvin_queue_setup,
.buf_prepare = rvin_buffer_prepare,
.buf_queue = rvin_buffer_queue,
diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
index cd0ff4a..a98f679 100644
--- a/drivers/media/platform/vim2m.c
+++ b/drivers/media/platform/vim2m.c
@@ -815,7 +815,7 @@ static void vim2m_stop_streaming(struct vb2_queue *q)
}
}
-static struct vb2_ops vim2m_qops = {
+static const struct vb2_ops vim2m_qops = {
.queue_setup = vim2m_queue_setup,
.buf_prepare = vim2m_buf_prepare,
.buf_queue = vim2m_buf_queue,
diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c
index fdec499..344028e 100644
--- a/drivers/media/platform/exynos4-is/fimc-capture.c
+++ b/drivers/media/platform/exynos4-is/fimc-capture.c
@@ -452,7 +452,7 @@ static void buffer_queue(struct vb2_buffer *vb)
spin_unlock_irqrestore(&fimc->slock, flags);
}
-static struct vb2_ops fimc_capture_qops = {
+static const struct vb2_ops fimc_capture_qops = {
.queue_setup = queue_setup,
.buf_prepare = buffer_prepare,
.buf_queue = buffer_queue,
diff --git a/drivers/media/platform/exynos4-is/fimc-m2m.c b/drivers/media/platform/exynos4-is/fimc-m2m.c
index b1309e1..6028e4f 100644
--- a/drivers/media/platform/exynos4-is/fimc-m2m.c
+++ b/drivers/media/platform/exynos4-is/fimc-m2m.c
@@ -219,7 +219,7 @@ static void fimc_buf_queue(struct vb2_buffer *vb)
v4l2_m2m_buf_queue(ctx->fh.m2m_ctx, vbuf);
}
-static struct vb2_ops fimc_qops = {
+static const struct vb2_ops fimc_qops = {
.queue_setup = fimc_queue_setup,
.buf_prepare = fimc_buf_prepare,
.buf_queue = fimc_buf_queue,
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
index 3ed3f2d..f8e4611 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
@@ -864,7 +864,7 @@ static void vb2ops_venc_stop_streaming(struct vb2_queue *q)
ctx->state = MTK_STATE_FREE;
}
-static struct vb2_ops mtk_venc_vb2_ops = {
+static const struct vb2_ops mtk_venc_vb2_ops = {
.queue_setup = vb2ops_venc_queue_setup,
.buf_prepare = vb2ops_venc_buf_prepare,
.buf_queue = vb2ops_venc_buf_queue,
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-01-25 10:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-21 9:29 [PATCH] media: platform: constify vb2_ops structures Bhumika Goyal
2017-01-25 10:08 ` Lad, Prabhakar
-- strict thread matches above, loose matches on Subject: below --
2016-09-08 23:59 [PATCH] [media] " Julia Lawall
2016-09-09 8:42 ` Laurent Pinchart
2016-09-09 8:53 ` Fabien DESSENNE
2016-09-09 9:48 ` Jacek Anaszewski
2016-09-09 16:03 ` Benoit Parrot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).