Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1720743 > unrolled thread
| Started by | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| First post | 2017-08-27 08:00 +0200 |
| Last post | 2017-08-27 23:50 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] staging: atomisp: constify v4l2_subdev_sensor_ops Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-27 08:00 +0200
Re: [PATCH] staging: atomisp: constify v4l2_subdev_sensor_ops Sakari Ailus <sakari.ailus@iki.fi> - 2017-08-27 23:50 +0200
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-08-27 08:00 +0200 |
| Subject | [PATCH] staging: atomisp: constify v4l2_subdev_sensor_ops |
| Message-ID | <uiYM1-3rd-1@gated-at.bofh.it> |
v4l2_subdev_sensor_ops are not supposed to change at runtime.
v4l2_subdev_sensor_ops are working with const 'sensor' field of
sturct v4l2_subdev_ops. So mark the non-const v4l2_subdev_sensor_ops
structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/staging/media/atomisp/i2c/mt9m114.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.c b/drivers/staging/media/atomisp/i2c/mt9m114.c
index 3fa9153..2c9b752 100644
--- a/drivers/staging/media/atomisp/i2c/mt9m114.c
+++ b/drivers/staging/media/atomisp/i2c/mt9m114.c
@@ -1806,7 +1806,7 @@ static const struct v4l2_subdev_video_ops mt9m114_video_ops = {
.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,
};
--
2.7.4
[toc] | [next] | [standalone]
| From | Sakari Ailus <sakari.ailus@iki.fi> |
|---|---|
| Date | 2017-08-27 23:50 +0200 |
| Message-ID | <ujdBn-504-5@gated-at.bofh.it> |
| In reply to | #1720743 |
Hi Arvind,
On Sun, Aug 27, 2017 at 11:26:39AM +0530, Arvind Yadav wrote:
> v4l2_subdev_sensor_ops are not supposed to change at runtime.
> v4l2_subdev_sensor_ops are working with const 'sensor' field of
> sturct v4l2_subdev_ops. So mark the non-const v4l2_subdev_sensor_ops
> structs as const.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Thanks for the patch. The change has already been made by this patch:
commit 65058214f5c2ebe844916b92d1bece64fd00206e
Author: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Tue Aug 8 06:58:29 2017 -0400
media: staging: media: atomisp: constify video_subdev structures
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web