* [PATCH 01/12] [media] st-delta: constify v4l2_m2m_ops structures
2017-08-06 8:25 [PATCH 00/12] constify v4l2_m2m_ops structures Julia Lawall
@ 2017-08-06 8:25 ` Julia Lawall
2017-08-06 8:25 ` [PATCH 02/12] [media] media: ti-vpe: vpe: " Julia Lawall
` (10 subsequent siblings)
11 siblings, 0 replies; 18+ messages in thread
From: Julia Lawall @ 2017-08-06 8:25 UTC (permalink / raw)
To: Hugues Fruchet
Cc: bhumirks, kernel-janitors, Mauro Carvalho Chehab, linux-media,
linux-kernel
The v4l2_m2m_ops structures are only passed as the only
argument to v4l2_m2m_init, which is declared as const.
Thus the v4l2_m2m_ops structures themselves can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct v4l2_m2m_ops i@p = { ... };
@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i@p)
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct v4l2_m2m_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/media/platform/sti/delta/delta-v4l2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/sti/delta/delta-v4l2.c b/drivers/media/platform/sti/delta/delta-v4l2.c
index ff9850e..b2dc3d2 100644
--- a/drivers/media/platform/sti/delta/delta-v4l2.c
+++ b/drivers/media/platform/sti/delta/delta-v4l2.c
@@ -1095,7 +1095,7 @@ static int delta_job_ready(void *priv)
}
/* mem-to-mem ops */
-static struct v4l2_m2m_ops delta_m2m_ops = {
+static const struct v4l2_m2m_ops delta_m2m_ops = {
.device_run = delta_device_run,
.job_ready = delta_job_ready,
.job_abort = delta_job_abort,
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 02/12] [media] media: ti-vpe: vpe: constify v4l2_m2m_ops structures
2017-08-06 8:25 [PATCH 00/12] constify v4l2_m2m_ops structures Julia Lawall
2017-08-06 8:25 ` [PATCH 01/12] [media] st-delta: " Julia Lawall
@ 2017-08-06 8:25 ` Julia Lawall
2017-08-06 8:25 ` [PATCH 03/12] [media] s5p-g2d: " Julia Lawall
` (9 subsequent siblings)
11 siblings, 0 replies; 18+ messages in thread
From: Julia Lawall @ 2017-08-06 8:25 UTC (permalink / raw)
To: Benoit Parrot
Cc: bhumirks, kernel-janitors, Mauro Carvalho Chehab, linux-media,
linux-kernel
The v4l2_m2m_ops structures are only passed as the only
argument to v4l2_m2m_init, which is declared as const.
Thus the v4l2_m2m_ops structures themselves can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct v4l2_m2m_ops i@p = { ... };
@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i@p)
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct v4l2_m2m_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/media/platform/ti-vpe/vpe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
index c471514..2873c22 100644
--- a/drivers/media/platform/ti-vpe/vpe.c
+++ b/drivers/media/platform/ti-vpe/vpe.c
@@ -2430,7 +2430,7 @@ static int vpe_release(struct file *file)
.vfl_dir = VFL_DIR_M2M,
};
-static struct v4l2_m2m_ops m2m_ops = {
+static const struct v4l2_m2m_ops m2m_ops = {
.device_run = device_run,
.job_ready = job_ready,
.job_abort = job_abort,
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 03/12] [media] s5p-g2d: constify v4l2_m2m_ops structures
2017-08-06 8:25 [PATCH 00/12] constify v4l2_m2m_ops structures Julia Lawall
2017-08-06 8:25 ` [PATCH 01/12] [media] st-delta: " Julia Lawall
2017-08-06 8:25 ` [PATCH 02/12] [media] media: ti-vpe: vpe: " Julia Lawall
@ 2017-08-06 8:25 ` Julia Lawall
[not found] ` <CGME20170807102341epcas2p2da8478bd73ca0678071912323830e456@epcas2p2.samsung.com>
2017-08-06 8:25 ` [PATCH 04/12] [media] V4L2: platform: rcar_jpu: " Julia Lawall
` (8 subsequent siblings)
11 siblings, 1 reply; 18+ messages in thread
From: Julia Lawall @ 2017-08-06 8:25 UTC (permalink / raw)
To: Kyungmin Park
Cc: bhumirks, kernel-janitors, Kamil Debski, Andrzej Hajda,
Mauro Carvalho Chehab, linux-arm-kernel, linux-media,
linux-kernel
The v4l2_m2m_ops structures are only passed as the only
argument to v4l2_m2m_init, which is declared as const.
Thus the v4l2_m2m_ops structures themselves can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct v4l2_m2m_ops i@p = { ... };
@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i@p)
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct v4l2_m2m_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/media/platform/s5p-g2d/g2d.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/s5p-g2d/g2d.c b/drivers/media/platform/s5p-g2d/g2d.c
index 81ed5cd..bd655b5 100644
--- a/drivers/media/platform/s5p-g2d/g2d.c
+++ b/drivers/media/platform/s5p-g2d/g2d.c
@@ -611,7 +611,7 @@ static irqreturn_t g2d_isr(int irq, void *prv)
.vfl_dir = VFL_DIR_M2M,
};
-static struct v4l2_m2m_ops g2d_m2m_ops = {
+static const struct v4l2_m2m_ops g2d_m2m_ops = {
.device_run = device_run,
.job_abort = job_abort,
};
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 04/12] [media] V4L2: platform: rcar_jpu: constify v4l2_m2m_ops structures
2017-08-06 8:25 [PATCH 00/12] constify v4l2_m2m_ops structures Julia Lawall
` (2 preceding siblings ...)
2017-08-06 8:25 ` [PATCH 03/12] [media] s5p-g2d: " Julia Lawall
@ 2017-08-06 8:25 ` Julia Lawall
2017-08-10 13:38 ` Mikhail Ulyanov
2017-08-06 8:25 ` [PATCH 05/12] [media] vcodec: mediatek: " Julia Lawall
` (7 subsequent siblings)
11 siblings, 1 reply; 18+ messages in thread
From: Julia Lawall @ 2017-08-06 8:25 UTC (permalink / raw)
To: Mikhail Ulyanov
Cc: bhumirks, kernel-janitors, Mauro Carvalho Chehab, linux-media,
linux-kernel
The v4l2_m2m_ops structures are only passed as the only
argument to v4l2_m2m_init, which is declared as const.
Thus the v4l2_m2m_ops structures themselves can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct v4l2_m2m_ops i@p = { ... };
@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i@p)
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct v4l2_m2m_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/media/platform/rcar_jpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/rcar_jpu.c b/drivers/media/platform/rcar_jpu.c
index d1746ec..070bac3 100644
--- a/drivers/media/platform/rcar_jpu.c
+++ b/drivers/media/platform/rcar_jpu.c
@@ -1506,7 +1506,7 @@ static void jpu_job_abort(void *priv)
jpu_cleanup(ctx, true);
}
-static struct v4l2_m2m_ops jpu_m2m_ops = {
+static const struct v4l2_m2m_ops jpu_m2m_ops = {
.device_run = jpu_device_run,
.job_ready = jpu_job_ready,
.job_abort = jpu_job_abort,
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 04/12] [media] V4L2: platform: rcar_jpu: constify v4l2_m2m_ops structures
2017-08-06 8:25 ` [PATCH 04/12] [media] V4L2: platform: rcar_jpu: " Julia Lawall
@ 2017-08-10 13:38 ` Mikhail Ulyanov
0 siblings, 0 replies; 18+ messages in thread
From: Mikhail Ulyanov @ 2017-08-10 13:38 UTC (permalink / raw)
To: Julia Lawall
Cc: bhumirks, kernel-janitors, Mauro Carvalho Chehab,
Linux Media Mailing List, linux-kernel
On Sun, Aug 6, 2017 at 11:25 AM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> The v4l2_m2m_ops structures are only passed as the only
> argument to v4l2_m2m_init, which is declared as const.
> Thus the v4l2_m2m_ops structures themselves can be const.
>
> Done with the help of Coccinelle.
>
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct v4l2_m2m_ops i@p = { ... };
>
> @ok1@
> identifier r.i;
> position p;
> @@
> v4l2_m2m_init(&i@p)
>
> @bad@
> position p != {r.p,ok1.p};
> identifier r.i;
> struct v4l2_m2m_ops e;
> @@
> e@i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
> struct v4l2_m2m_ops i = { ... };
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Ulyanov Mikhail <mikhail.ulyanov@cogentembedded.com>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 05/12] [media] vcodec: mediatek: constify v4l2_m2m_ops structures
2017-08-06 8:25 [PATCH 00/12] constify v4l2_m2m_ops structures Julia Lawall
` (3 preceding siblings ...)
2017-08-06 8:25 ` [PATCH 04/12] [media] V4L2: platform: rcar_jpu: " Julia Lawall
@ 2017-08-06 8:25 ` Julia Lawall
2017-08-07 2:42 ` Rick Chang
2017-08-06 8:25 ` [PATCH 06/12] [media] exynos-gsc: " Julia Lawall
` (6 subsequent siblings)
11 siblings, 1 reply; 18+ messages in thread
From: Julia Lawall @ 2017-08-06 8:25 UTC (permalink / raw)
To: Rick Chang
Cc: bhumirks, kernel-janitors, Bin Liu, Mauro Carvalho Chehab,
Matthias Brugger, linux-media, linux-arm-kernel, linux-mediatek,
linux-kernel
The v4l2_m2m_ops structures are only passed as the only
argument to v4l2_m2m_init, which is declared as const.
Thus the v4l2_m2m_ops structures themselves can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct v4l2_m2m_ops i@p = { ... };
@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i@p)
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct v4l2_m2m_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
index f17a86b..226f908 100644
--- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
@@ -865,7 +865,7 @@ static void mtk_jpeg_job_abort(void *priv)
{
}
-static struct v4l2_m2m_ops mtk_jpeg_m2m_ops = {
+static const struct v4l2_m2m_ops mtk_jpeg_m2m_ops = {
.device_run = mtk_jpeg_device_run,
.job_ready = mtk_jpeg_job_ready,
.job_abort = mtk_jpeg_job_abort,
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 05/12] [media] vcodec: mediatek: constify v4l2_m2m_ops structures
2017-08-06 8:25 ` [PATCH 05/12] [media] vcodec: mediatek: " Julia Lawall
@ 2017-08-07 2:42 ` Rick Chang
0 siblings, 0 replies; 18+ messages in thread
From: Rick Chang @ 2017-08-07 2:42 UTC (permalink / raw)
To: Julia Lawall
Cc: bhumirks, kernel-janitors, Bin Liu, Mauro Carvalho Chehab,
Matthias Brugger, linux-media, linux-arm-kernel, linux-mediatek,
linux-kernel
On Sun, 2017-08-06 at 10:25 +0200, Julia Lawall wrote:
> The v4l2_m2m_ops structures are only passed as the only
> argument to v4l2_m2m_init, which is declared as const.
> Thus the v4l2_m2m_ops structures themselves can be const.
>
> Done with the help of Coccinelle.
>
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct v4l2_m2m_ops i@p = { ... };
>
> @ok1@
> identifier r.i;
> position p;
> @@
> v4l2_m2m_init(&i@p)
>
> @bad@
> position p != {r.p,ok1.p};
> identifier r.i;
> struct v4l2_m2m_ops e;
> @@
> e@i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
> struct v4l2_m2m_ops i = { ... };
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
---
> drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Rick Chang <rick.chang@mediatek.com>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 06/12] [media] exynos-gsc: constify v4l2_m2m_ops structures
2017-08-06 8:25 [PATCH 00/12] constify v4l2_m2m_ops structures Julia Lawall
` (4 preceding siblings ...)
2017-08-06 8:25 ` [PATCH 05/12] [media] vcodec: mediatek: " Julia Lawall
@ 2017-08-06 8:25 ` Julia Lawall
[not found] ` <CGME20170807101839epcas2p41e7c3092b876487e132a8a640e9ed262@epcas2p4.samsung.com>
2017-08-06 8:25 ` [PATCH 07/12] [media] bdisp: " Julia Lawall
` (5 subsequent siblings)
11 siblings, 1 reply; 18+ messages in thread
From: Julia Lawall @ 2017-08-06 8:25 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: bhumirks, kernel-janitors, Kukjin Kim, Krzysztof Kozlowski,
linux-media, linux-arm-kernel, linux-samsung-soc, linux-kernel
The v4l2_m2m_ops structures are only passed as the only
argument to v4l2_m2m_init, which is declared as const.
Thus the v4l2_m2m_ops structures themselves can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct v4l2_m2m_ops i@p = { ... };
@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i@p)
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct v4l2_m2m_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/media/platform/exynos-gsc/gsc-m2m.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c
index 33611a4..2a2994e 100644
--- a/drivers/media/platform/exynos-gsc/gsc-m2m.c
+++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c
@@ -747,7 +747,7 @@ static int gsc_m2m_mmap(struct file *file, struct vm_area_struct *vma)
.mmap = gsc_m2m_mmap,
};
-static struct v4l2_m2m_ops gsc_m2m_ops = {
+static const struct v4l2_m2m_ops gsc_m2m_ops = {
.device_run = gsc_m2m_device_run,
.job_abort = gsc_m2m_job_abort,
};
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 07/12] [media] bdisp: constify v4l2_m2m_ops structures
2017-08-06 8:25 [PATCH 00/12] constify v4l2_m2m_ops structures Julia Lawall
` (5 preceding siblings ...)
2017-08-06 8:25 ` [PATCH 06/12] [media] exynos-gsc: " Julia Lawall
@ 2017-08-06 8:25 ` Julia Lawall
2017-08-06 8:25 ` [PATCH 08/12] [media] m2m-deinterlace: " Julia Lawall
` (4 subsequent siblings)
11 siblings, 0 replies; 18+ messages in thread
From: Julia Lawall @ 2017-08-06 8:25 UTC (permalink / raw)
To: Fabien Dessenne
Cc: bhumirks, kernel-janitors, Mauro Carvalho Chehab, linux-media,
linux-kernel
The v4l2_m2m_ops structures are only passed as the only
argument to v4l2_m2m_init, which is declared as const.
Thus the v4l2_m2m_ops structures themselves can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct v4l2_m2m_ops i@p = { ... };
@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i@p)
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct v4l2_m2m_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
index 7918b92..939da6d 100644
--- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
+++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
@@ -360,7 +360,7 @@ static void bdisp_device_run(void *priv)
bdisp_job_finish(ctx, VB2_BUF_STATE_ERROR);
}
-static struct v4l2_m2m_ops bdisp_m2m_ops = {
+static const struct v4l2_m2m_ops bdisp_m2m_ops = {
.device_run = bdisp_device_run,
.job_abort = bdisp_job_abort,
};
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 08/12] [media] m2m-deinterlace: constify v4l2_m2m_ops structures
2017-08-06 8:25 [PATCH 00/12] constify v4l2_m2m_ops structures Julia Lawall
` (6 preceding siblings ...)
2017-08-06 8:25 ` [PATCH 07/12] [media] bdisp: " Julia Lawall
@ 2017-08-06 8:25 ` Julia Lawall
2017-08-06 8:25 ` [PATCH 09/12] [media] media: mx2-emmaprp: " Julia Lawall
` (3 subsequent siblings)
11 siblings, 0 replies; 18+ messages in thread
From: Julia Lawall @ 2017-08-06 8:25 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: bhumirks, kernel-janitors, linux-media, linux-kernel
The v4l2_m2m_ops structures are only passed as the only
argument to v4l2_m2m_init, which is declared as const.
Thus the v4l2_m2m_ops structures themselves can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct v4l2_m2m_ops i@p = { ... };
@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i@p)
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct v4l2_m2m_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/media/platform/m2m-deinterlace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c
index 980066b..98f6db2 100644
--- a/drivers/media/platform/m2m-deinterlace.c
+++ b/drivers/media/platform/m2m-deinterlace.c
@@ -988,7 +988,7 @@ static int deinterlace_mmap(struct file *file, struct vm_area_struct *vma)
.vfl_dir = VFL_DIR_M2M,
};
-static struct v4l2_m2m_ops m2m_ops = {
+static const struct v4l2_m2m_ops m2m_ops = {
.device_run = deinterlace_device_run,
.job_ready = deinterlace_job_ready,
.job_abort = deinterlace_job_abort,
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 09/12] [media] media: mx2-emmaprp: constify v4l2_m2m_ops structures
2017-08-06 8:25 [PATCH 00/12] constify v4l2_m2m_ops structures Julia Lawall
` (7 preceding siblings ...)
2017-08-06 8:25 ` [PATCH 08/12] [media] m2m-deinterlace: " Julia Lawall
@ 2017-08-06 8:25 ` Julia Lawall
2017-08-06 8:25 ` [PATCH 10/12] [media] vim2m: " Julia Lawall
` (2 subsequent siblings)
11 siblings, 0 replies; 18+ messages in thread
From: Julia Lawall @ 2017-08-06 8:25 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: bhumirks, kernel-janitors, linux-media, linux-kernel
The v4l2_m2m_ops structures are only passed as the only
argument to v4l2_m2m_init, which is declared as const.
Thus the v4l2_m2m_ops structures themselves can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct v4l2_m2m_ops i@p = { ... };
@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i@p)
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct v4l2_m2m_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/media/platform/mx2_emmaprp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/mx2_emmaprp.c b/drivers/media/platform/mx2_emmaprp.c
index 03e47e0..7fd209e 100644
--- a/drivers/media/platform/mx2_emmaprp.c
+++ b/drivers/media/platform/mx2_emmaprp.c
@@ -882,7 +882,7 @@ static int emmaprp_mmap(struct file *file, struct vm_area_struct *vma)
.vfl_dir = VFL_DIR_M2M,
};
-static struct v4l2_m2m_ops m2m_ops = {
+static const struct v4l2_m2m_ops m2m_ops = {
.device_run = emmaprp_device_run,
.job_abort = emmaprp_job_abort,
.lock = emmaprp_lock,
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 10/12] [media] vim2m: constify v4l2_m2m_ops structures
2017-08-06 8:25 [PATCH 00/12] constify v4l2_m2m_ops structures Julia Lawall
` (8 preceding siblings ...)
2017-08-06 8:25 ` [PATCH 09/12] [media] media: mx2-emmaprp: " Julia Lawall
@ 2017-08-06 8:25 ` Julia Lawall
2017-08-06 8:25 ` [PATCH 11/12] [media] exynos4-is: " Julia Lawall
2017-08-06 8:25 ` [PATCH 12/12] [media] mtk-mdp: " Julia Lawall
11 siblings, 0 replies; 18+ messages in thread
From: Julia Lawall @ 2017-08-06 8:25 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: bhumirks, kernel-janitors, linux-media, linux-kernel
The v4l2_m2m_ops structures are only passed as the only
argument to v4l2_m2m_init, which is declared as const.
Thus the v4l2_m2m_ops structures themselves can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct v4l2_m2m_ops i@p = { ... };
@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i@p)
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct v4l2_m2m_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/media/platform/vim2m.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
index 970b9b6..afbaa35 100644
--- a/drivers/media/platform/vim2m.c
+++ b/drivers/media/platform/vim2m.c
@@ -983,7 +983,7 @@ static int vim2m_release(struct file *file)
.release = video_device_release_empty,
};
-static struct v4l2_m2m_ops m2m_ops = {
+static const struct v4l2_m2m_ops m2m_ops = {
.device_run = device_run,
.job_ready = job_ready,
.job_abort = job_abort,
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 11/12] [media] exynos4-is: constify v4l2_m2m_ops structures
2017-08-06 8:25 [PATCH 00/12] constify v4l2_m2m_ops structures Julia Lawall
` (9 preceding siblings ...)
2017-08-06 8:25 ` [PATCH 10/12] [media] vim2m: " Julia Lawall
@ 2017-08-06 8:25 ` Julia Lawall
[not found] ` <CGME20170807101941epcas2p446c04b9a0813cb56f33202e6b4fdc49b@epcas2p4.samsung.com>
2017-08-06 8:25 ` [PATCH 12/12] [media] mtk-mdp: " Julia Lawall
11 siblings, 1 reply; 18+ messages in thread
From: Julia Lawall @ 2017-08-06 8:25 UTC (permalink / raw)
To: Kyungmin Park
Cc: bhumirks, kernel-janitors, Sylwester Nawrocki,
Mauro Carvalho Chehab, Kukjin Kim, Krzysztof Kozlowski,
linux-media, linux-arm-kernel, linux-samsung-soc, linux-kernel
The v4l2_m2m_ops structures are only passed as the only
argument to v4l2_m2m_init, which is declared as const.
Thus the v4l2_m2m_ops structures themselves can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct v4l2_m2m_ops i@p = { ... };
@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i@p)
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct v4l2_m2m_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/media/platform/exynos4-is/fimc-m2m.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/exynos4-is/fimc-m2m.c b/drivers/media/platform/exynos4-is/fimc-m2m.c
index d8724fe..9027d0b 100644
--- a/drivers/media/platform/exynos4-is/fimc-m2m.c
+++ b/drivers/media/platform/exynos4-is/fimc-m2m.c
@@ -704,7 +704,7 @@ static int fimc_m2m_release(struct file *file)
.mmap = v4l2_m2m_fop_mmap,
};
-static struct v4l2_m2m_ops m2m_ops = {
+static const struct v4l2_m2m_ops m2m_ops = {
.device_run = fimc_device_run,
.job_abort = fimc_job_abort,
};
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 12/12] [media] mtk-mdp: constify v4l2_m2m_ops structures
2017-08-06 8:25 [PATCH 00/12] constify v4l2_m2m_ops structures Julia Lawall
` (10 preceding siblings ...)
2017-08-06 8:25 ` [PATCH 11/12] [media] exynos4-is: " Julia Lawall
@ 2017-08-06 8:25 ` Julia Lawall
11 siblings, 0 replies; 18+ messages in thread
From: Julia Lawall @ 2017-08-06 8:25 UTC (permalink / raw)
To: Minghsiu Tsai
Cc: bhumirks, kernel-janitors, Houlong Wei, Andrew-CT Chen,
Mauro Carvalho Chehab, Matthias Brugger, linux-media,
linux-arm-kernel, linux-mediatek, linux-kernel
The v4l2_m2m_ops structures are only passed as the only
argument to v4l2_m2m_init, which is declared as const.
Thus the v4l2_m2m_ops structures themselves can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct v4l2_m2m_ops i@p = { ... };
@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i@p)
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct v4l2_m2m_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
index 3038d62..583d477 100644
--- a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
+++ b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
@@ -1225,7 +1225,7 @@ static int mtk_mdp_m2m_release(struct file *file)
.mmap = v4l2_m2m_fop_mmap,
};
-static struct v4l2_m2m_ops mtk_mdp_m2m_ops = {
+static const struct v4l2_m2m_ops mtk_mdp_m2m_ops = {
.device_run = mtk_mdp_m2m_device_run,
.job_abort = mtk_mdp_m2m_job_abort,
};
^ permalink raw reply related [flat|nested] 18+ messages in thread