media: fimc-is: constify local pointers to fimc_fmt
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sun, 24 Dec 2023 11:49:11 +0000 (12:49 +0100)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 22 Jan 2024 11:16:42 +0000 (12:16 +0100)
Constify the local variable pointing to "struct fimc_fmt" to annotate
the function is not modifying pointed data.  This is the easy and
obvious step of constifying all "struct fimc_fmt" instances.

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-m2m.c
drivers/media/platform/samsung/exynos4-is/fimc-reg.c

index 05cafba1c7287adbf65fda31d80330fc4009d23d..dde36e5be0c735c1aac915cc5c28009a7955e398 100644 (file)
@@ -343,7 +343,7 @@ static int queue_setup(struct vb2_queue *vq,
 {
        struct fimc_ctx *ctx = vq->drv_priv;
        struct fimc_frame *frame = &ctx->d_frame;
-       struct fimc_fmt *fmt = frame->fmt;
+       const struct fimc_fmt *fmt = frame->fmt;
        unsigned long wh = frame->f_width * frame->f_height;
        int i;
 
@@ -722,7 +722,7 @@ static int fimc_cap_querycap(struct file *file, void *priv,
 static int fimc_cap_enum_fmt(struct file *file, void *priv,
                             struct v4l2_fmtdesc *f)
 {
-       struct fimc_fmt *fmt;
+       const struct fimc_fmt *fmt;
 
        fmt = fimc_find_format(NULL, NULL, FMT_FLAGS_CAM | FMT_FLAGS_M2M,
                               f->index);
@@ -1460,7 +1460,7 @@ static int fimc_subdev_enum_mbus_code(struct v4l2_subdev *sd,
                                      struct v4l2_subdev_state *sd_state,
                                      struct v4l2_subdev_mbus_code_enum *code)
 {
-       struct fimc_fmt *fmt;
+       const struct fimc_fmt *fmt;
 
        fmt = fimc_find_format(NULL, NULL, FMT_FLAGS_CAM, code->index);
        if (!fmt)
index df8e2aa454d8fa920b3cfcc3d9fd213ef85f504a..1918390a2469d76b80b0b2aa4086e9c1e53af078 100644 (file)
@@ -237,7 +237,7 @@ static int fimc_m2m_querycap(struct file *file, void *fh,
 static int fimc_m2m_enum_fmt(struct file *file, void *priv,
                             struct v4l2_fmtdesc *f)
 {
-       struct fimc_fmt *fmt;
+       const struct fimc_fmt *fmt;
 
        fmt = fimc_find_format(NULL, NULL, get_m2m_fmt_flags(f->type),
                               f->index);
@@ -266,7 +266,7 @@ static int fimc_try_fmt_mplane(struct fimc_ctx *ctx, struct v4l2_format *f)
        struct fimc_dev *fimc = ctx->fimc_dev;
        const struct fimc_variant *variant = fimc->variant;
        struct v4l2_pix_format_mplane *pix = &f->fmt.pix_mp;
-       struct fimc_fmt *fmt;
+       const struct fimc_fmt *fmt;
        u32 max_w, mod_x, mod_y;
 
        if (!IS_M2M(f->type))
index f20fb74dd0c68ccbf307ef91900bb9b198cb6b11..dbc43b7033244c539116d9010c39b43619b831be 100644 (file)
@@ -168,7 +168,7 @@ void fimc_hw_set_out_dma(struct fimc_ctx *ctx)
        struct fimc_dev *dev = ctx->fimc_dev;
        struct fimc_frame *frame = &ctx->d_frame;
        struct fimc_dma_offset *offset = &frame->dma_offset;
-       struct fimc_fmt *fmt = frame->fmt;
+       const struct fimc_fmt *fmt = frame->fmt;
        u32 cfg;
 
        /* Set the input dma offsets. */