media: fimc-is: constify pointers to v4l2_pix_format_mplane
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sun, 24 Dec 2023 11:49:13 +0000 (12:49 +0100)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 22 Jan 2024 11:16:42 +0000 (12:16 +0100)
In few places functions do not modify pointed "struct
v4l2_pix_format_mplane", thus the pointer can point to const data for
additional safety and self-documenting intention of the function.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/samsung/exynos4-is/fimc-capture.c
drivers/media/platform/samsung/exynos4-is/fimc-isp-video.c
drivers/media/platform/samsung/exynos4-is/fimc-m2m.c

index a3a677a3065f97d7076714692b897c3127751d43..7c2bcd5be9339899f49a2bde0912d4a93f76658e 100644 (file)
@@ -1010,7 +1010,7 @@ static int __fimc_capture_set_format(struct fimc_dev *fimc,
 {
        struct fimc_vid_cap *vc = &fimc->vid_cap;
        struct fimc_ctx *ctx = vc->ctx;
-       struct v4l2_pix_format_mplane *pix = &f->fmt.pix_mp;
+       const struct v4l2_pix_format_mplane *pix = &f->fmt.pix_mp;
        struct fimc_frame *ff = &ctx->d_frame;
        const struct fimc_fmt *inp_fmt = NULL;
        int ret, i;
index 8fa26969c4111ecdb97b1174f579187df6520add..06c4352562b38fb7cce395b31698f3798b06bc77 100644 (file)
@@ -40,7 +40,7 @@ static int isp_video_capture_queue_setup(struct vb2_queue *vq,
                        unsigned int sizes[], struct device *alloc_devs[])
 {
        struct fimc_isp *isp = vb2_get_drv_priv(vq);
-       struct v4l2_pix_format_mplane *vid_fmt = &isp->video_capture.pixfmt;
+       const struct v4l2_pix_format_mplane *vid_fmt = &isp->video_capture.pixfmt;
        const struct fimc_fmt *fmt = isp->video_capture.format;
        unsigned int wh, i;
 
index e9023f64cfbab515479eecabcd10cb5192726a35..e5829a457f3db531f094f2713bf7e73f44014f29 100644 (file)
@@ -316,7 +316,7 @@ static int fimc_m2m_try_fmt_mplane(struct file *file, void *fh,
 
 static void __set_frame_format(struct fimc_frame *frame,
                               const struct fimc_fmt *fmt,
-                              struct v4l2_pix_format_mplane *pixm)
+                              const struct v4l2_pix_format_mplane *pixm)
 {
        int i;