public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 00/12] constify v4l2_m2m_ops structures
@ 2017-08-06  8:25 Julia Lawall
  2017-08-06  8:25 ` [PATCH 03/12] [media] s5p-g2d: " Julia Lawall
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Julia Lawall @ 2017-08-06  8:25 UTC (permalink / raw)
  To: linux-arm-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.

---

 drivers/media/platform/exynos-gsc/gsc-m2m.c     |    2 +-
 drivers/media/platform/exynos4-is/fimc-m2m.c    |    2 +-
 drivers/media/platform/m2m-deinterlace.c        |    2 +-
 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c |    2 +-
 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c    |    2 +-
 drivers/media/platform/mx2_emmaprp.c            |    2 +-
 drivers/media/platform/rcar_jpu.c               |    2 +-
 drivers/media/platform/s5p-g2d/g2d.c            |    2 +-
 drivers/media/platform/sti/bdisp/bdisp-v4l2.c   |    2 +-
 drivers/media/platform/sti/delta/delta-v4l2.c   |    2 +-
 drivers/media/platform/ti-vpe/vpe.c             |    2 +-
 drivers/media/platform/vim2m.c                  |    2 +-
 12 files changed, 12 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 10+ 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 ` Julia Lawall
  2017-08-07 10:23   ` Sylwester Nawrocki
  2017-08-06  8:25 ` [PATCH 05/12] [media] vcodec: mediatek: " Julia Lawall
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Julia Lawall @ 2017-08-06  8:25 UTC (permalink / raw)
  To: linux-arm-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 at p = { ... };

@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i at p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e at 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] 10+ 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
  2017-08-06  8:25 ` [PATCH 03/12] [media] s5p-g2d: " 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
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Julia Lawall @ 2017-08-06  8:25 UTC (permalink / raw)
  To: linux-arm-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 at p = { ... };

@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i at p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e at 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] 10+ 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
  2017-08-06  8:25 ` [PATCH 03/12] [media] s5p-g2d: " Julia Lawall
  2017-08-06  8:25 ` [PATCH 05/12] [media] vcodec: mediatek: " Julia Lawall
@ 2017-08-06  8:25 ` Julia Lawall
  2017-08-07 10:18   ` Sylwester Nawrocki
  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
  4 siblings, 1 reply; 10+ messages in thread
From: Julia Lawall @ 2017-08-06  8:25 UTC (permalink / raw)
  To: linux-arm-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 at p = { ... };

@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i at p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e at 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] 10+ 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
                   ` (2 preceding siblings ...)
  2017-08-06  8:25 ` [PATCH 06/12] [media] exynos-gsc: " Julia Lawall
@ 2017-08-06  8:25 ` Julia Lawall
  2017-08-07 10:19   ` Sylwester Nawrocki
  2017-08-06  8:25 ` [PATCH 12/12] [media] mtk-mdp: " Julia Lawall
  4 siblings, 1 reply; 10+ messages in thread
From: Julia Lawall @ 2017-08-06  8:25 UTC (permalink / raw)
  To: linux-arm-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 at p = { ... };

@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i at p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e at 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] 10+ 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
                   ` (3 preceding siblings ...)
  2017-08-06  8:25 ` [PATCH 11/12] [media] exynos4-is: " Julia Lawall
@ 2017-08-06  8:25 ` Julia Lawall
  4 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2017-08-06  8:25 UTC (permalink / raw)
  To: linux-arm-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 at p = { ... };

@ok1@
identifier r.i;
position p;
@@
v4l2_m2m_init(&i at p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct v4l2_m2m_ops e;
@@
e at 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] 10+ messages in thread

* [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; 10+ messages in thread
From: Rick Chang @ 2017-08-07  2:42 UTC (permalink / raw)
  To: linux-arm-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 at p = { ... };
> 
> @ok1@
> identifier r.i;
> position p;
> @@
> v4l2_m2m_init(&i at p)
> 
> @bad@
> position p != {r.p,ok1.p};
> identifier r.i;
> struct v4l2_m2m_ops e;
> @@
> e at 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] 10+ messages in thread

* [PATCH 06/12] [media] exynos-gsc: constify v4l2_m2m_ops structures
  2017-08-06  8:25 ` [PATCH 06/12] [media] exynos-gsc: " Julia Lawall
@ 2017-08-07 10:18   ` Sylwester Nawrocki
  0 siblings, 0 replies; 10+ messages in thread
From: Sylwester Nawrocki @ 2017-08-07 10:18 UTC (permalink / raw)
  To: linux-arm-kernel

On 08/06/2017 10:25 AM, 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.

> Signed-off-by: Julia Lawall<Julia.Lawall@lip6.fr>

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 11/12] [media] exynos4-is: constify v4l2_m2m_ops structures
  2017-08-06  8:25 ` [PATCH 11/12] [media] exynos4-is: " Julia Lawall
@ 2017-08-07 10:19   ` Sylwester Nawrocki
  0 siblings, 0 replies; 10+ messages in thread
From: Sylwester Nawrocki @ 2017-08-07 10:19 UTC (permalink / raw)
  To: linux-arm-kernel

On 08/06/2017 10:25 AM, 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.

> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 03/12] [media] s5p-g2d: constify v4l2_m2m_ops structures
  2017-08-06  8:25 ` [PATCH 03/12] [media] s5p-g2d: " Julia Lawall
@ 2017-08-07 10:23   ` Sylwester Nawrocki
  0 siblings, 0 replies; 10+ messages in thread
From: Sylwester Nawrocki @ 2017-08-07 10:23 UTC (permalink / raw)
  To: linux-arm-kernel

On 08/06/2017 10:25 AM, 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.

> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-08-07 10:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-06  8:25 [PATCH 00/12] constify v4l2_m2m_ops structures Julia Lawall
2017-08-06  8:25 ` [PATCH 03/12] [media] s5p-g2d: " Julia Lawall
2017-08-07 10:23   ` Sylwester Nawrocki
2017-08-06  8:25 ` [PATCH 05/12] [media] vcodec: mediatek: " Julia Lawall
2017-08-07  2:42   ` Rick Chang
2017-08-06  8:25 ` [PATCH 06/12] [media] exynos-gsc: " Julia Lawall
2017-08-07 10:18   ` Sylwester Nawrocki
2017-08-06  8:25 ` [PATCH 11/12] [media] exynos4-is: " Julia Lawall
2017-08-07 10:19   ` Sylwester Nawrocki
2017-08-06  8:25 ` [PATCH 12/12] [media] mtk-mdp: " Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox