linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] constify video_subdev structures
@ 2017-08-08 10:58 Julia Lawall
  2017-08-08 10:58 ` [PATCH 1/6] [media] v4l: mt9t001: " Julia Lawall
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Julia Lawall @ 2017-08-08 10:58 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: bhumirks, kernel-janitors, linux-arm-kernel, devel,
	Mauro Carvalho Chehab, linux-media, linux-kernel

The structures of type v4l2_subdev_ops are only passed as the second
argument of v4l2_subdev_init or as the third argument of
v4l2_i2c_subdev_init, both of which are const.  The structures of type
v4l2_subdev_core_ops, v4l2_subdev_pad_ops, v4l2_subdev_sensor_ops,
v4l2_subdev_video_ops are only stored in fields of v4l2_subdev_ops
structures, all of which are const.  Thus all of these structures can be
declared as const as well.

Done with the help of Coccinelle.

---

 drivers/media/i2c/mt9m111.c                   |    6 +++---
 drivers/media/i2c/mt9t001.c                   |    8 ++++----
 drivers/media/platform/exynos4-is/fimc-isp.c  |    2 +-
 drivers/media/platform/exynos4-is/fimc-lite.c |    2 +-
 drivers/media/platform/vimc/vimc-debayer.c    |    2 +-
 drivers/media/platform/vimc/vimc-scaler.c     |    2 +-
 drivers/media/platform/vimc/vimc-sensor.c     |    2 +-
 drivers/media/usb/uvc/uvc_entity.c            |    2 +-
 drivers/staging/media/atomisp/i2c/ap1302.c    |    2 +-
 drivers/staging/media/atomisp/i2c/mt9m114.c   |    2 +-
 10 files changed, 15 insertions(+), 15 deletions(-)

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

* [PATCH 1/6] [media] v4l: mt9t001: constify video_subdev structures
  2017-08-08 10:58 [PATCH 0/6] constify video_subdev structures Julia Lawall
@ 2017-08-08 10:58 ` Julia Lawall
  2017-08-08 22:07   ` Laurent Pinchart
  2017-08-08 10:58 ` [PATCH 2/6] [media] vimc: " Julia Lawall
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Julia Lawall @ 2017-08-08 10:58 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: bhumirks, kernel-janitors, Mauro Carvalho Chehab, linux-media,
	linux-kernel

The v4l2_subdev_ops structure is only passed as the third argument of
v4l2_i2c_subdev_init, which is const, so the v4l2_subdev_ops structure
can be const as well.  The other structures are only stored in the
v4l2_subdev_ops structure, all the fields of which are const, so these
structures can also be const.

Done with the help of Coccinelle.

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

---
 drivers/media/i2c/mt9t001.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/i2c/mt9t001.c b/drivers/media/i2c/mt9t001.c
index 842017f..9d981d9 100644
--- a/drivers/media/i2c/mt9t001.c
+++ b/drivers/media/i2c/mt9t001.c
@@ -822,15 +822,15 @@ static int mt9t001_close(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh)
 	return mt9t001_set_power(subdev, 0);
 }
 
-static struct v4l2_subdev_core_ops mt9t001_subdev_core_ops = {
+static const struct v4l2_subdev_core_ops mt9t001_subdev_core_ops = {
 	.s_power = mt9t001_set_power,
 };
 
-static struct v4l2_subdev_video_ops mt9t001_subdev_video_ops = {
+static const struct v4l2_subdev_video_ops mt9t001_subdev_video_ops = {
 	.s_stream = mt9t001_s_stream,
 };
 
-static struct v4l2_subdev_pad_ops mt9t001_subdev_pad_ops = {
+static const struct v4l2_subdev_pad_ops mt9t001_subdev_pad_ops = {
 	.enum_mbus_code = mt9t001_enum_mbus_code,
 	.enum_frame_size = mt9t001_enum_frame_size,
 	.get_fmt = mt9t001_get_format,
@@ -839,7 +839,7 @@ static int mt9t001_close(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh)
 	.set_selection = mt9t001_set_selection,
 };
 
-static struct v4l2_subdev_ops mt9t001_subdev_ops = {
+static const struct v4l2_subdev_ops mt9t001_subdev_ops = {
 	.core = &mt9t001_subdev_core_ops,
 	.video = &mt9t001_subdev_video_ops,
 	.pad = &mt9t001_subdev_pad_ops,

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

* [PATCH 2/6] [media] vimc: constify video_subdev structures
  2017-08-08 10:58 [PATCH 0/6] constify video_subdev structures Julia Lawall
  2017-08-08 10:58 ` [PATCH 1/6] [media] v4l: mt9t001: " Julia Lawall
@ 2017-08-08 10:58 ` Julia Lawall
  2017-08-08 10:58 ` [PATCH 3/6] staging: atomisp: " Julia Lawall
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Julia Lawall @ 2017-08-08 10:58 UTC (permalink / raw)
  To: Helen Koike
  Cc: bhumirks, kernel-janitors, Mauro Carvalho Chehab, linux-media,
	linux-kernel

These structures are all only stored in fields of v4l2_subdev_ops
structures, all of which are const, so these structures can be const
as well.

Done with the help of Coccinelle.

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

---
 drivers/media/platform/vimc/vimc-debayer.c |    2 +-
 drivers/media/platform/vimc/vimc-scaler.c  |    2 +-
 drivers/media/platform/vimc/vimc-sensor.c  |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/vimc/vimc-debayer.c b/drivers/media/platform/vimc/vimc-debayer.c
index 033a131..4d663e8 100644
--- a/drivers/media/platform/vimc/vimc-debayer.c
+++ b/drivers/media/platform/vimc/vimc-debayer.c
@@ -373,7 +373,7 @@ static int vimc_deb_s_stream(struct v4l2_subdev *sd, int enable)
 	return 0;
 }
 
-static struct v4l2_subdev_video_ops vimc_deb_video_ops = {
+static const struct v4l2_subdev_video_ops vimc_deb_video_ops = {
 	.s_stream = vimc_deb_s_stream,
 };
 
diff --git a/drivers/media/platform/vimc/vimc-scaler.c b/drivers/media/platform/vimc/vimc-scaler.c
index 0a3e086..e1602e0 100644
--- a/drivers/media/platform/vimc/vimc-scaler.c
+++ b/drivers/media/platform/vimc/vimc-scaler.c
@@ -267,7 +267,7 @@ static int vimc_sca_s_stream(struct v4l2_subdev *sd, int enable)
 	return 0;
 }
 
-static struct v4l2_subdev_video_ops vimc_sca_video_ops = {
+static const struct v4l2_subdev_video_ops vimc_sca_video_ops = {
 	.s_stream = vimc_sca_s_stream,
 };
 
diff --git a/drivers/media/platform/vimc/vimc-sensor.c b/drivers/media/platform/vimc/vimc-sensor.c
index 615c2b1..02e68c8 100644
--- a/drivers/media/platform/vimc/vimc-sensor.c
+++ b/drivers/media/platform/vimc/vimc-sensor.c
@@ -282,7 +282,7 @@ static int vimc_sen_s_stream(struct v4l2_subdev *sd, int enable)
 	return 0;
 }
 
-static struct v4l2_subdev_video_ops vimc_sen_video_ops = {
+static const struct v4l2_subdev_video_ops vimc_sen_video_ops = {
 	.s_stream = vimc_sen_s_stream,
 };
 

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

* [PATCH 3/6] staging: atomisp: constify video_subdev structures
  2017-08-08 10:58 [PATCH 0/6] constify video_subdev structures Julia Lawall
  2017-08-08 10:58 ` [PATCH 1/6] [media] v4l: mt9t001: " Julia Lawall
  2017-08-08 10:58 ` [PATCH 2/6] [media] vimc: " Julia Lawall
@ 2017-08-08 10:58 ` Julia Lawall
  2017-08-08 10:58 ` [PATCH 4/6] [media] media: mt9m111: " Julia Lawall
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Julia Lawall @ 2017-08-08 10:58 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: bhumirks, kernel-janitors, Greg Kroah-Hartman, linux-media,
	devel, linux-kernel

These structures are both stored in fields of v4l2_subdev_ops
structures, all of which are const, so these structures can be
const as well.

Done with the help of Coccinelle.

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

---
 drivers/staging/media/atomisp/i2c/ap1302.c  |    2 +-
 drivers/staging/media/atomisp/i2c/mt9m114.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c b/drivers/staging/media/atomisp/i2c/ap1302.c
index bacffbe..de687c6 100644
--- a/drivers/staging/media/atomisp/i2c/ap1302.c
+++ b/drivers/staging/media/atomisp/i2c/ap1302.c
@@ -1098,7 +1098,7 @@ static long ap1302_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
 	},
 };
 
-static struct v4l2_subdev_sensor_ops ap1302_sensor_ops = {
+static const struct v4l2_subdev_sensor_ops ap1302_sensor_ops = {
 	.g_skip_frames	= ap1302_g_skip_frames,
 };
 
diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.c b/drivers/staging/media/atomisp/i2c/mt9m114.c
index 448e072..36a0636 100644
--- a/drivers/staging/media/atomisp/i2c/mt9m114.c
+++ b/drivers/staging/media/atomisp/i2c/mt9m114.c
@@ -1806,7 +1806,7 @@ static int mt9m114_g_skip_frames(struct v4l2_subdev *sd, u32 *frames)
 	.g_frame_interval = mt9m114_g_frame_interval,
 };
 
-static struct v4l2_subdev_sensor_ops mt9m114_sensor_ops = {
+static const struct v4l2_subdev_sensor_ops mt9m114_sensor_ops = {
 	.g_skip_frames	= mt9m114_g_skip_frames,
 };
 

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

* [PATCH 4/6] [media] media: mt9m111: constify video_subdev structures
  2017-08-08 10:58 [PATCH 0/6] constify video_subdev structures Julia Lawall
                   ` (2 preceding siblings ...)
  2017-08-08 10:58 ` [PATCH 3/6] staging: atomisp: " Julia Lawall
@ 2017-08-08 10:58 ` Julia Lawall
  2017-08-08 10:58 ` [PATCH 5/6] [media] exynos4-is: " Julia Lawall
  2017-08-08 10:58 ` [PATCH 6/6] [media] uvcvideo: " Julia Lawall
  5 siblings, 0 replies; 11+ messages in thread
From: Julia Lawall @ 2017-08-08 10:58 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: bhumirks, kernel-janitors, linux-media, linux-kernel

The v4l2_subdev_ops structure is only passed as the third argument
of v4l2_i2c_subdev_init, which is const, so the v4l2_subdev_ops
structure can be const as well.  The other structures are only
stored in the v4l2_subdev_ops structure, all the fields of which are
const, so these structures can also be const.

Done with the help of Coccinelle.

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

---
 drivers/media/i2c/mt9m111.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c
index 72e71b7..99b992e 100644
--- a/drivers/media/i2c/mt9m111.c
+++ b/drivers/media/i2c/mt9m111.c
@@ -835,7 +835,7 @@ static int mt9m111_s_power(struct v4l2_subdev *sd, int on)
 	.s_ctrl = mt9m111_s_ctrl,
 };
 
-static struct v4l2_subdev_core_ops mt9m111_subdev_core_ops = {
+static const struct v4l2_subdev_core_ops mt9m111_subdev_core_ops = {
 	.s_power	= mt9m111_s_power,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 	.g_register	= mt9m111_g_register,
@@ -865,7 +865,7 @@ static int mt9m111_g_mbus_config(struct v4l2_subdev *sd,
 	return 0;
 }
 
-static struct v4l2_subdev_video_ops mt9m111_subdev_video_ops = {
+static const struct v4l2_subdev_video_ops mt9m111_subdev_video_ops = {
 	.g_mbus_config	= mt9m111_g_mbus_config,
 };
 
@@ -877,7 +877,7 @@ static int mt9m111_g_mbus_config(struct v4l2_subdev *sd,
 	.set_fmt	= mt9m111_set_fmt,
 };
 
-static struct v4l2_subdev_ops mt9m111_subdev_ops = {
+static const struct v4l2_subdev_ops mt9m111_subdev_ops = {
 	.core	= &mt9m111_subdev_core_ops,
 	.video	= &mt9m111_subdev_video_ops,
 	.pad	= &mt9m111_subdev_pad_ops,

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

* [PATCH 5/6] [media] exynos4-is: constify video_subdev structures
  2017-08-08 10:58 [PATCH 0/6] constify video_subdev structures Julia Lawall
                   ` (3 preceding siblings ...)
  2017-08-08 10:58 ` [PATCH 4/6] [media] media: mt9m111: " Julia Lawall
@ 2017-08-08 10:58 ` Julia Lawall
       [not found]   ` <CGME20170808123709epcas2p229a31cfa19e3a5bf3986e547162e2613@epcas2p2.samsung.com>
  2017-08-08 10:58 ` [PATCH 6/6] [media] uvcvideo: " Julia Lawall
  5 siblings, 1 reply; 11+ messages in thread
From: Julia Lawall @ 2017-08-08 10:58 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_subdev_ops structures are only passed as the second
argument of v4l2_subdev_init, which is const, so the
v4l2_subdev_ops structures can be const as well.

Done with the help of Coccinelle.

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

---
 drivers/media/platform/exynos4-is/fimc-isp.c  |    2 +-
 drivers/media/platform/exynos4-is/fimc-lite.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/exynos4-is/fimc-isp.c b/drivers/media/platform/exynos4-is/fimc-isp.c
index 8efe916..fd793d3 100644
--- a/drivers/media/platform/exynos4-is/fimc-isp.c
+++ b/drivers/media/platform/exynos4-is/fimc-isp.c
@@ -433,7 +433,7 @@ static void fimc_isp_subdev_unregistered(struct v4l2_subdev *sd)
 	.s_power = fimc_isp_subdev_s_power,
 };
 
-static struct v4l2_subdev_ops fimc_is_subdev_ops = {
+static const struct v4l2_subdev_ops fimc_is_subdev_ops = {
 	.core = &fimc_is_core_ops,
 	.video = &fimc_is_subdev_video_ops,
 	.pad = &fimc_is_subdev_pad_ops,
diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
index 7d3ec5c..30282c5 100644
--- a/drivers/media/platform/exynos4-is/fimc-lite.c
+++ b/drivers/media/platform/exynos4-is/fimc-lite.c
@@ -1361,7 +1361,7 @@ static void fimc_lite_subdev_unregistered(struct v4l2_subdev *sd)
 	.log_status = fimc_lite_log_status,
 };
 
-static struct v4l2_subdev_ops fimc_lite_subdev_ops = {
+static const struct v4l2_subdev_ops fimc_lite_subdev_ops = {
 	.core = &fimc_lite_core_ops,
 	.video = &fimc_lite_subdev_video_ops,
 	.pad = &fimc_lite_subdev_pad_ops,

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

* [PATCH 6/6] [media] uvcvideo: constify video_subdev structures
  2017-08-08 10:58 [PATCH 0/6] constify video_subdev structures Julia Lawall
                   ` (4 preceding siblings ...)
  2017-08-08 10:58 ` [PATCH 5/6] [media] exynos4-is: " Julia Lawall
@ 2017-08-08 10:58 ` Julia Lawall
  2017-08-08 12:49   ` Laurent Pinchart
  5 siblings, 1 reply; 11+ messages in thread
From: Julia Lawall @ 2017-08-08 10:58 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: bhumirks, kernel-janitors, Mauro Carvalho Chehab, linux-media,
	linux-kernel

uvc_subdev_ops is only passed as the second argument of
v4l2_subdev_init, which is const, so uvc_subdev_ops can be
const as well.

Done with the help of Coccinelle.

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

---
 drivers/media/usb/uvc/uvc_entity.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/uvc/uvc_entity.c b/drivers/media/usb/uvc/uvc_entity.c
index ac386bb..554063c 100644
--- a/drivers/media/usb/uvc/uvc_entity.c
+++ b/drivers/media/usb/uvc/uvc_entity.c
@@ -61,7 +61,7 @@ static int uvc_mc_create_links(struct uvc_video_chain *chain,
 	return 0;
 }
 
-static struct v4l2_subdev_ops uvc_subdev_ops = {
+static const struct v4l2_subdev_ops uvc_subdev_ops = {
 };
 
 void uvc_mc_cleanup_entity(struct uvc_entity *entity)

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

* Re: [PATCH 5/6] [media] exynos4-is: constify video_subdev structures
       [not found]   ` <CGME20170808123709epcas2p229a31cfa19e3a5bf3986e547162e2613@epcas2p2.samsung.com>
@ 2017-08-08 12:37     ` Sylwester Nawrocki
  0 siblings, 0 replies; 11+ messages in thread
From: Sylwester Nawrocki @ 2017-08-08 12:37 UTC (permalink / raw)
  To: Julia Lawall, linux-media
  Cc: Kyungmin Park, bhumirks, kernel-janitors, Mauro Carvalho Chehab,
	Kukjin Kim, Krzysztof Kozlowski, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

On 08/08/2017 12:58 PM, Julia Lawall wrote:
> The v4l2_subdev_ops structures are only passed as the second
> argument of v4l2_subdev_init, which is const, so the
> v4l2_subdev_ops structures can be const as well.
> 
> 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] 11+ messages in thread

* Re: [PATCH 6/6] [media] uvcvideo: constify video_subdev structures
  2017-08-08 10:58 ` [PATCH 6/6] [media] uvcvideo: " Julia Lawall
@ 2017-08-08 12:49   ` Laurent Pinchart
  2017-08-08 12:49     ` Julia Lawall
  0 siblings, 1 reply; 11+ messages in thread
From: Laurent Pinchart @ 2017-08-08 12:49 UTC (permalink / raw)
  To: Julia Lawall
  Cc: bhumirks, kernel-janitors, Mauro Carvalho Chehab, linux-media,
	linux-kernel

Hi Julia,

Thank you for the patch.

On Tuesday 08 Aug 2017 12:58:32 Julia Lawall wrote:
> uvc_subdev_ops is only passed as the second argument of
> v4l2_subdev_init, which is const, so uvc_subdev_ops can be
> const as well.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

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

and applied to my tree (with the first word of the commit message after the 
prefix capitalized to match the rest of the driver's commit messages, let me 
know if that's a problem :-)).
> 
> ---
>  drivers/media/usb/uvc/uvc_entity.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_entity.c
> b/drivers/media/usb/uvc/uvc_entity.c index ac386bb..554063c 100644
> --- a/drivers/media/usb/uvc/uvc_entity.c
> +++ b/drivers/media/usb/uvc/uvc_entity.c
> @@ -61,7 +61,7 @@ static int uvc_mc_create_links(struct uvc_video_chain
> *chain, return 0;
>  }
> 
> -static struct v4l2_subdev_ops uvc_subdev_ops = {
> +static const struct v4l2_subdev_ops uvc_subdev_ops = {
>  };
> 
>  void uvc_mc_cleanup_entity(struct uvc_entity *entity)

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 6/6] [media] uvcvideo: constify video_subdev structures
  2017-08-08 12:49   ` Laurent Pinchart
@ 2017-08-08 12:49     ` Julia Lawall
  0 siblings, 0 replies; 11+ messages in thread
From: Julia Lawall @ 2017-08-08 12:49 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: bhumirks, kernel-janitors, Mauro Carvalho Chehab, linux-media,
	linux-kernel



On Tue, 8 Aug 2017, Laurent Pinchart wrote:

> Hi Julia,
>
> Thank you for the patch.
>
> On Tuesday 08 Aug 2017 12:58:32 Julia Lawall wrote:
> > uvc_subdev_ops is only passed as the second argument of
> > v4l2_subdev_init, which is const, so uvc_subdev_ops can be
> > const as well.
> >
> > Done with the help of Coccinelle.
> >
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> and applied to my tree (with the first word of the commit message after the
> prefix capitalized to match the rest of the driver's commit messages, let me
> know if that's a problem :-)).

No, of course not.  I will try to watch out for that in the future.

julia

> >
> > ---
> >  drivers/media/usb/uvc/uvc_entity.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/usb/uvc/uvc_entity.c
> > b/drivers/media/usb/uvc/uvc_entity.c index ac386bb..554063c 100644
> > --- a/drivers/media/usb/uvc/uvc_entity.c
> > +++ b/drivers/media/usb/uvc/uvc_entity.c
> > @@ -61,7 +61,7 @@ static int uvc_mc_create_links(struct uvc_video_chain
> > *chain, return 0;
> >  }
> >
> > -static struct v4l2_subdev_ops uvc_subdev_ops = {
> > +static const struct v4l2_subdev_ops uvc_subdev_ops = {
> >  };
> >
> >  void uvc_mc_cleanup_entity(struct uvc_entity *entity)
>
> --
> Regards,
>
> Laurent Pinchart
>
>

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

* Re: [PATCH 1/6] [media] v4l: mt9t001: constify video_subdev structures
  2017-08-08 10:58 ` [PATCH 1/6] [media] v4l: mt9t001: " Julia Lawall
@ 2017-08-08 22:07   ` Laurent Pinchart
  0 siblings, 0 replies; 11+ messages in thread
From: Laurent Pinchart @ 2017-08-08 22:07 UTC (permalink / raw)
  To: Julia Lawall
  Cc: bhumirks, kernel-janitors, Mauro Carvalho Chehab, linux-media,
	linux-kernel

Hi Julia,

Thank you for the patch.

On Tuesday 08 Aug 2017 12:58:27 Julia Lawall wrote:
> The v4l2_subdev_ops structure is only passed as the third argument of
> v4l2_i2c_subdev_init, which is const, so the v4l2_subdev_ops structure
> can be const as well.  The other structures are only stored in the
> v4l2_subdev_ops structure, all the fields of which are const, so these
> structures can also be const.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

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

> ---
>  drivers/media/i2c/mt9t001.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/i2c/mt9t001.c b/drivers/media/i2c/mt9t001.c
> index 842017f..9d981d9 100644
> --- a/drivers/media/i2c/mt9t001.c
> +++ b/drivers/media/i2c/mt9t001.c
> @@ -822,15 +822,15 @@ static int mt9t001_close(struct v4l2_subdev *subdev,
> struct v4l2_subdev_fh *fh) return mt9t001_set_power(subdev, 0);
>  }
> 
> -static struct v4l2_subdev_core_ops mt9t001_subdev_core_ops = {
> +static const struct v4l2_subdev_core_ops mt9t001_subdev_core_ops = {
>  	.s_power = mt9t001_set_power,
>  };
> 
> -static struct v4l2_subdev_video_ops mt9t001_subdev_video_ops = {
> +static const struct v4l2_subdev_video_ops mt9t001_subdev_video_ops = {
>  	.s_stream = mt9t001_s_stream,
>  };
> 
> -static struct v4l2_subdev_pad_ops mt9t001_subdev_pad_ops = {
> +static const struct v4l2_subdev_pad_ops mt9t001_subdev_pad_ops = {
>  	.enum_mbus_code = mt9t001_enum_mbus_code,
>  	.enum_frame_size = mt9t001_enum_frame_size,
>  	.get_fmt = mt9t001_get_format,
> @@ -839,7 +839,7 @@ static int mt9t001_close(struct v4l2_subdev *subdev,
> struct v4l2_subdev_fh *fh) .set_selection = mt9t001_set_selection,
>  };
> 
> -static struct v4l2_subdev_ops mt9t001_subdev_ops = {
> +static const struct v4l2_subdev_ops mt9t001_subdev_ops = {
>  	.core = &mt9t001_subdev_core_ops,
>  	.video = &mt9t001_subdev_video_ops,
>  	.pad = &mt9t001_subdev_pad_ops,

-- 
Regards,

Laurent Pinchart

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

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

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-08 10:58 [PATCH 0/6] constify video_subdev structures Julia Lawall
2017-08-08 10:58 ` [PATCH 1/6] [media] v4l: mt9t001: " Julia Lawall
2017-08-08 22:07   ` Laurent Pinchart
2017-08-08 10:58 ` [PATCH 2/6] [media] vimc: " Julia Lawall
2017-08-08 10:58 ` [PATCH 3/6] staging: atomisp: " Julia Lawall
2017-08-08 10:58 ` [PATCH 4/6] [media] media: mt9m111: " Julia Lawall
2017-08-08 10:58 ` [PATCH 5/6] [media] exynos4-is: " Julia Lawall
     [not found]   ` <CGME20170808123709epcas2p229a31cfa19e3a5bf3986e547162e2613@epcas2p2.samsung.com>
2017-08-08 12:37     ` Sylwester Nawrocki
2017-08-08 10:58 ` [PATCH 6/6] [media] uvcvideo: " Julia Lawall
2017-08-08 12:49   ` Laurent Pinchart
2017-08-08 12:49     ` Julia Lawall

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