kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] i2c: constify v4l2_ctrl_ops structures
@ 2015-11-13 22:05 Julia Lawall
  2015-11-16 11:06 ` Lad, Prabhakar
  2015-11-16 20:21 ` Laurent Pinchart
  0 siblings, 2 replies; 3+ messages in thread
From: Julia Lawall @ 2015-11-13 22:05 UTC (permalink / raw)
  To: Lad Prabhakar
  Cc: kernel-janitors, linux-kernel, linux-media,
	Mauro Carvalho Chehab, Laurent Pinchart

These v4l2_ctrl_ops structures are never modified, like all the other
v4l2_ctrl_ops structures, so declare them as const.

Done with the help of Coccinelle.

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

---
 drivers/media/i2c/mt9m032.c |    2 +-
 drivers/media/i2c/mt9p031.c |    2 +-
 drivers/media/i2c/mt9t001.c |    2 +-
 drivers/media/i2c/mt9v011.c |    2 +-
 drivers/media/i2c/mt9v032.c |    2 +-
 drivers/media/i2c/ov2659.c  |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/i2c/mt9t001.c b/drivers/media/i2c/mt9t001.c
index 8ae99f7..3486bc8 100644
--- a/drivers/media/i2c/mt9t001.c
+++ b/drivers/media/i2c/mt9t001.c
@@ -626,7 +626,7 @@ static int mt9t001_s_ctrl(struct v4l2_ctrl *ctrl)
 	return 0;
 }
 
-static struct v4l2_ctrl_ops mt9t001_ctrl_ops = {
+static const struct v4l2_ctrl_ops mt9t001_ctrl_ops = {
 	.s_ctrl = mt9t001_s_ctrl,
 };
 
diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
index a68ce94..b8e80c0 100644
--- a/drivers/media/i2c/mt9v032.c
+++ b/drivers/media/i2c/mt9v032.c
@@ -703,7 +703,7 @@ static int mt9v032_s_ctrl(struct v4l2_ctrl *ctrl)
 	return 0;
 }
 
-static struct v4l2_ctrl_ops mt9v032_ctrl_ops = {
+static const struct v4l2_ctrl_ops mt9v032_ctrl_ops = {
 	.s_ctrl = mt9v032_s_ctrl,
 };
 
diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
index 0db15f5..1e78aa2 100644
--- a/drivers/media/i2c/mt9p031.c
+++ b/drivers/media/i2c/mt9p031.c
@@ -817,7 +817,7 @@ static int mt9p031_s_ctrl(struct v4l2_ctrl *ctrl)
 	return 0;
 }
 
-static struct v4l2_ctrl_ops mt9p031_ctrl_ops = {
+static const struct v4l2_ctrl_ops mt9p031_ctrl_ops = {
 	.s_ctrl = mt9p031_s_ctrl,
 };
 
diff --git a/drivers/media/i2c/mt9v011.c b/drivers/media/i2c/mt9v011.c
index a4a5c39..c681b3b 100644
--- a/drivers/media/i2c/mt9v011.c
+++ b/drivers/media/i2c/mt9v011.c
@@ -454,7 +454,7 @@ static int mt9v011_s_ctrl(struct v4l2_ctrl *ctrl)
 	return 0;
 }
 
-static struct v4l2_ctrl_ops mt9v011_ctrl_ops = {
+static const struct v4l2_ctrl_ops mt9v011_ctrl_ops = {
 	.s_ctrl = mt9v011_s_ctrl,
 };
 
diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
index 49109f4..b952e7d 100644
--- a/drivers/media/i2c/ov2659.c
+++ b/drivers/media/i2c/ov2659.c
@@ -1249,7 +1249,7 @@ static int ov2659_s_ctrl(struct v4l2_ctrl *ctrl)
 	return 0;
 }
 
-static struct v4l2_ctrl_ops ov2659_ctrl_ops = {
+static const struct v4l2_ctrl_ops ov2659_ctrl_ops = {
 	.s_ctrl = ov2659_s_ctrl,
 };
 
diff --git a/drivers/media/i2c/mt9m032.c b/drivers/media/i2c/mt9m032.c
index c7747bd..eec064e 100644
--- a/drivers/media/i2c/mt9m032.c
+++ b/drivers/media/i2c/mt9m032.c
@@ -671,7 +671,7 @@ static int mt9m032_set_ctrl(struct v4l2_ctrl *ctrl)
 	return 0;
 }
 
-static struct v4l2_ctrl_ops mt9m032_ctrl_ops = {
+static const struct v4l2_ctrl_ops mt9m032_ctrl_ops = {
 	.s_ctrl = mt9m032_set_ctrl,
 	.try_ctrl = mt9m032_try_ctrl,
 };


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

* Re: [PATCH] [media] i2c: constify v4l2_ctrl_ops structures
  2015-11-13 22:05 [PATCH] [media] i2c: constify v4l2_ctrl_ops structures Julia Lawall
@ 2015-11-16 11:06 ` Lad, Prabhakar
  2015-11-16 20:21 ` Laurent Pinchart
  1 sibling, 0 replies; 3+ messages in thread
From: Lad, Prabhakar @ 2015-11-16 11:06 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, LKML, linux-media, Mauro Carvalho Chehab,
	Laurent Pinchart

On Fri, Nov 13, 2015 at 10:05 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> These v4l2_ctrl_ops structures are never modified, like all the other
> v4l2_ctrl_ops structures, so declare them as const.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>

Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Cheers,
--Prabhakar Lad

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

* Re: [PATCH] [media] i2c: constify v4l2_ctrl_ops structures
  2015-11-13 22:05 [PATCH] [media] i2c: constify v4l2_ctrl_ops structures Julia Lawall
  2015-11-16 11:06 ` Lad, Prabhakar
@ 2015-11-16 20:21 ` Laurent Pinchart
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2015-11-16 20:21 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Lad Prabhakar, kernel-janitors, linux-kernel, linux-media,
	Mauro Carvalho Chehab

Hi Julia,

Thank you for the patch.

On Friday 13 November 2015 23:05:17 Julia Lawall wrote:
> These v4l2_ctrl_ops structures are never modified, like all the other
> v4l2_ctrl_ops structures, so declare them as const.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

and applied to my tree. I've prefixed the subject line with "v4l: i2c" instead 
of just "i2c".

> ---
>  drivers/media/i2c/mt9m032.c |    2 +-
>  drivers/media/i2c/mt9p031.c |    2 +-
>  drivers/media/i2c/mt9t001.c |    2 +-
>  drivers/media/i2c/mt9v011.c |    2 +-
>  drivers/media/i2c/mt9v032.c |    2 +-
>  drivers/media/i2c/ov2659.c  |    2 +-
>  6 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/i2c/mt9t001.c b/drivers/media/i2c/mt9t001.c
> index 8ae99f7..3486bc8 100644
> --- a/drivers/media/i2c/mt9t001.c
> +++ b/drivers/media/i2c/mt9t001.c
> @@ -626,7 +626,7 @@ static int mt9t001_s_ctrl(struct v4l2_ctrl *ctrl)
>  	return 0;
>  }
> 
> -static struct v4l2_ctrl_ops mt9t001_ctrl_ops = {
> +static const struct v4l2_ctrl_ops mt9t001_ctrl_ops = {
>  	.s_ctrl = mt9t001_s_ctrl,
>  };
> 
> diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
> index a68ce94..b8e80c0 100644
> --- a/drivers/media/i2c/mt9v032.c
> +++ b/drivers/media/i2c/mt9v032.c
> @@ -703,7 +703,7 @@ static int mt9v032_s_ctrl(struct v4l2_ctrl *ctrl)
>  	return 0;
>  }
> 
> -static struct v4l2_ctrl_ops mt9v032_ctrl_ops = {
> +static const struct v4l2_ctrl_ops mt9v032_ctrl_ops = {
>  	.s_ctrl = mt9v032_s_ctrl,
>  };
> 
> diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
> index 0db15f5..1e78aa2 100644
> --- a/drivers/media/i2c/mt9p031.c
> +++ b/drivers/media/i2c/mt9p031.c
> @@ -817,7 +817,7 @@ static int mt9p031_s_ctrl(struct v4l2_ctrl *ctrl)
>  	return 0;
>  }
> 
> -static struct v4l2_ctrl_ops mt9p031_ctrl_ops = {
> +static const struct v4l2_ctrl_ops mt9p031_ctrl_ops = {
>  	.s_ctrl = mt9p031_s_ctrl,
>  };
> 
> diff --git a/drivers/media/i2c/mt9v011.c b/drivers/media/i2c/mt9v011.c
> index a4a5c39..c681b3b 100644
> --- a/drivers/media/i2c/mt9v011.c
> +++ b/drivers/media/i2c/mt9v011.c
> @@ -454,7 +454,7 @@ static int mt9v011_s_ctrl(struct v4l2_ctrl *ctrl)
>  	return 0;
>  }
> 
> -static struct v4l2_ctrl_ops mt9v011_ctrl_ops = {
> +static const struct v4l2_ctrl_ops mt9v011_ctrl_ops = {
>  	.s_ctrl = mt9v011_s_ctrl,
>  };
> 
> diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
> index 49109f4..b952e7d 100644
> --- a/drivers/media/i2c/ov2659.c
> +++ b/drivers/media/i2c/ov2659.c
> @@ -1249,7 +1249,7 @@ static int ov2659_s_ctrl(struct v4l2_ctrl *ctrl)
>  	return 0;
>  }
> 
> -static struct v4l2_ctrl_ops ov2659_ctrl_ops = {
> +static const struct v4l2_ctrl_ops ov2659_ctrl_ops = {
>  	.s_ctrl = ov2659_s_ctrl,
>  };
> 
> diff --git a/drivers/media/i2c/mt9m032.c b/drivers/media/i2c/mt9m032.c
> index c7747bd..eec064e 100644
> --- a/drivers/media/i2c/mt9m032.c
> +++ b/drivers/media/i2c/mt9m032.c
> @@ -671,7 +671,7 @@ static int mt9m032_set_ctrl(struct v4l2_ctrl *ctrl)
>  	return 0;
>  }
> 
> -static struct v4l2_ctrl_ops mt9m032_ctrl_ops = {
> +static const struct v4l2_ctrl_ops mt9m032_ctrl_ops = {
>  	.s_ctrl = mt9m032_set_ctrl,
>  	.try_ctrl = mt9m032_try_ctrl,
>  };

-- 
Regards,

Laurent Pinchart


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

end of thread, other threads:[~2015-11-16 20:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-13 22:05 [PATCH] [media] i2c: constify v4l2_ctrl_ops structures Julia Lawall
2015-11-16 11:06 ` Lad, Prabhakar
2015-11-16 20:21 ` Laurent Pinchart

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).