Skip to contentSkip to conversation

media: staging/intel-ipu3: Constify static struct v4l2_subdev_internal_ops

PATCH New Rikard Falkeborn 1 participant 1 message Oct 5, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: staging/intel-ipu3: Constify static struct v4l2_subdev_internal_ops

The only usage of imgu_subdev_internal_ops is to assign its address to the internal_ops field in the v4l2_subdev struct, which is a pointer to const v4l2_subdev_internal_ops. Make it const to allow the compiler to put it in read-only memory.

---
 drivers/staging/media/ipu3/ipu3-v4l2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/ipu3/ipu3-v4l2.c +1 -1
index 38a240764509..b723186d2134 100644
@@ -864,7 +864,7 @@ static int imgu_vidioc_g_meta_fmt(struct file *file, void *fh,
 
 /******************** function pointers ********************/
 
-static struct v4l2_subdev_internal_ops imgu_subdev_internal_ops = {
+static const struct v4l2_subdev_internal_ops imgu_subdev_internal_ops = {
 	.open = imgu_subdev_open,
 };
 
Signature · 1 line
2.33.0