LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/2] constify structures stored in fields of v4l2_subdev_ops structure
@ 2018-10-27 12:49 Julia Lawall
2018-10-27 12:49 ` [PATCH 1/2] media: ov7740: " Julia Lawall
2018-10-27 12:49 ` [PATCH 2/2] media: vimc: " Julia Lawall
0 siblings, 2 replies; 4+ messages in thread
From: Julia Lawall @ 2018-10-27 12:49 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: kernel-janitors, linux-media, linux-kernel
The fields of a v4l2_subdev_ops structure are all const, so the
structures that are stored there and are not used elsewhere can be
const as well.
Done with the help of Coccinelle.
---
drivers/media/i2c/ov7740.c | 4 ++--
drivers/media/platform/vimc/vimc-sensor.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] media: ov7740: constify structures stored in fields of v4l2_subdev_ops structure
2018-10-27 12:49 [PATCH 0/2] constify structures stored in fields of v4l2_subdev_ops structure Julia Lawall
@ 2018-10-27 12:49 ` Julia Lawall
2018-10-27 12:49 ` [PATCH 2/2] media: vimc: " Julia Lawall
1 sibling, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2018-10-27 12:49 UTC (permalink / raw)
To: Wenyou Yang
Cc: kernel-janitors, Mauro Carvalho Chehab, linux-media, linux-kernel
The fields of a v4l2_subdev_ops structure are all const, so the
structures that are stored there and are not used elsewhere can be
const as well.
Done with the help of Coccinelle.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/media/i2c/ov7740.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/ov7740.c b/drivers/media/i2c/ov7740.c
index 6e9c233cfbe3..177688afd9a6 100644
--- a/drivers/media/i2c/ov7740.c
+++ b/drivers/media/i2c/ov7740.c
@@ -322,7 +322,7 @@ static int ov7740_set_power(struct ov7740 *ov7740, int on)
return 0;
}
-static struct v4l2_subdev_core_ops ov7740_subdev_core_ops = {
+static const struct v4l2_subdev_core_ops ov7740_subdev_core_ops = {
.log_status = v4l2_ctrl_subdev_log_status,
#ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = ov7740_get_register,
@@ -648,7 +648,7 @@ static int ov7740_s_frame_interval(struct v4l2_subdev *sd,
return 0;
}
-static struct v4l2_subdev_video_ops ov7740_subdev_video_ops = {
+static const struct v4l2_subdev_video_ops ov7740_subdev_video_ops = {
.s_stream = ov7740_set_stream,
.s_frame_interval = ov7740_s_frame_interval,
.g_frame_interval = ov7740_g_frame_interval,
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] media: vimc: constify structures stored in fields of v4l2_subdev_ops structure
2018-10-27 12:49 [PATCH 0/2] constify structures stored in fields of v4l2_subdev_ops structure Julia Lawall
2018-10-27 12:49 ` [PATCH 1/2] media: ov7740: " Julia Lawall
@ 2018-10-27 12:49 ` Julia Lawall
2018-11-01 11:49 ` Helen Koike
1 sibling, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2018-10-27 12:49 UTC (permalink / raw)
To: Helen Koike
Cc: kernel-janitors, Mauro Carvalho Chehab, linux-media, linux-kernel
The fields of a v4l2_subdev_ops structure are all const, so the
structures that are stored there and are not used elsewhere 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-sensor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/vimc/vimc-sensor.c b/drivers/media/platform/vimc/vimc-sensor.c
index edf4c85ae63d..32ca9c6172b1 100644
--- a/drivers/media/platform/vimc/vimc-sensor.c
+++ b/drivers/media/platform/vimc/vimc-sensor.c
@@ -286,7 +286,7 @@ static int vimc_sen_s_stream(struct v4l2_subdev *sd, int enable)
return 0;
}
-static struct v4l2_subdev_core_ops vimc_sen_core_ops = {
+static const struct v4l2_subdev_core_ops vimc_sen_core_ops = {
.log_status = v4l2_ctrl_subdev_log_status,
.subscribe_event = v4l2_ctrl_subdev_subscribe_event,
.unsubscribe_event = v4l2_event_subdev_unsubscribe,
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] media: vimc: constify structures stored in fields of v4l2_subdev_ops structure
2018-10-27 12:49 ` [PATCH 2/2] media: vimc: " Julia Lawall
@ 2018-11-01 11:49 ` Helen Koike
0 siblings, 0 replies; 4+ messages in thread
From: Helen Koike @ 2018-11-01 11:49 UTC (permalink / raw)
To: Julia Lawall
Cc: kernel-janitors, Mauro Carvalho Chehab, linux-media, linux-kernel
Hi Julia,
Thanks, I had missed that one.
On 10/27/18 10:49 AM, Julia Lawall wrote:
> The fields of a v4l2_subdev_ops structure are all const, so the
> structures that are stored there and are not used elsewhere can be
> const as well.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Helen Koike <helen.koike@collabora.com>
>
> ---
> drivers/media/platform/vimc/vimc-sensor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/vimc/vimc-sensor.c b/drivers/media/platform/vimc/vimc-sensor.c
> index edf4c85ae63d..32ca9c6172b1 100644
> --- a/drivers/media/platform/vimc/vimc-sensor.c
> +++ b/drivers/media/platform/vimc/vimc-sensor.c
> @@ -286,7 +286,7 @@ static int vimc_sen_s_stream(struct v4l2_subdev *sd, int enable)
> return 0;
> }
>
> -static struct v4l2_subdev_core_ops vimc_sen_core_ops = {
> +static const struct v4l2_subdev_core_ops vimc_sen_core_ops = {
> .log_status = v4l2_ctrl_subdev_log_status,
> .subscribe_event = v4l2_ctrl_subdev_subscribe_event,
> .unsubscribe_event = v4l2_event_subdev_unsubscribe,
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-11-01 11:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-27 12:49 [PATCH 0/2] constify structures stored in fields of v4l2_subdev_ops structure Julia Lawall
2018-10-27 12:49 ` [PATCH 1/2] media: ov7740: " Julia Lawall
2018-10-27 12:49 ` [PATCH 2/2] media: vimc: " Julia Lawall
2018-11-01 11:49 ` Helen Koike
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).