media: s5p-mfc: constify local pointers to s5p_mfc_enc_params
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sun, 24 Dec 2023 15:44:11 +0000 (16:44 +0100)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 22 Jan 2024 11:16:43 +0000 (12:16 +0100)
Constify the local variables pointing to "struct s5p_mfc_enc_params" and
other encoding params to annotate the function is not modifying pointed
data.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c

index 7a322c80f7c1380ae7df8dee9c98605c397644d3..7dee61c8c0b616b77306c9ab69f97d1d6ab54779 100644 (file)
@@ -676,7 +676,7 @@ static int s5p_mfc_set_enc_ref_buffer_v5(struct s5p_mfc_ctx *ctx)
 static int s5p_mfc_set_enc_params(struct s5p_mfc_ctx *ctx)
 {
        struct s5p_mfc_dev *dev = ctx->dev;
-       struct s5p_mfc_enc_params *p = &ctx->enc_params;
+       const struct s5p_mfc_enc_params *p = &ctx->enc_params;
        unsigned int reg;
        unsigned int shm;
 
@@ -759,8 +759,8 @@ static int s5p_mfc_set_enc_params(struct s5p_mfc_ctx *ctx)
 static int s5p_mfc_set_enc_params_h264(struct s5p_mfc_ctx *ctx)
 {
        struct s5p_mfc_dev *dev = ctx->dev;
-       struct s5p_mfc_enc_params *p = &ctx->enc_params;
-       struct s5p_mfc_h264_enc_params *p_264 = &p->codec.h264;
+       const struct s5p_mfc_enc_params *p = &ctx->enc_params;
+       const struct s5p_mfc_h264_enc_params *p_264 = &p->codec.h264;
        unsigned int reg;
        unsigned int shm;
 
@@ -916,8 +916,8 @@ static int s5p_mfc_set_enc_params_h264(struct s5p_mfc_ctx *ctx)
 static int s5p_mfc_set_enc_params_mpeg4(struct s5p_mfc_ctx *ctx)
 {
        struct s5p_mfc_dev *dev = ctx->dev;
-       struct s5p_mfc_enc_params *p = &ctx->enc_params;
-       struct s5p_mfc_mpeg4_enc_params *p_mpeg4 = &p->codec.mpeg4;
+       const struct s5p_mfc_enc_params *p = &ctx->enc_params;
+       const struct s5p_mfc_mpeg4_enc_params *p_mpeg4 = &p->codec.mpeg4;
        unsigned int reg;
        unsigned int shm;
        unsigned int framerate;
@@ -995,8 +995,8 @@ static int s5p_mfc_set_enc_params_mpeg4(struct s5p_mfc_ctx *ctx)
 static int s5p_mfc_set_enc_params_h263(struct s5p_mfc_ctx *ctx)
 {
        struct s5p_mfc_dev *dev = ctx->dev;
-       struct s5p_mfc_enc_params *p = &ctx->enc_params;
-       struct s5p_mfc_mpeg4_enc_params *p_h263 = &p->codec.mpeg4;
+       const struct s5p_mfc_enc_params *p = &ctx->enc_params;
+       const struct s5p_mfc_mpeg4_enc_params *p_h263 = &p->codec.mpeg4;
        unsigned int reg;
        unsigned int shm;
 
index 07a999bd127f949393fcf2189e332016b823d52c..923d4b40dd6762dc58a156e0a01bd183d79332f7 100644 (file)
@@ -863,7 +863,7 @@ static int s5p_mfc_set_enc_params(struct s5p_mfc_ctx *ctx)
 {
        struct s5p_mfc_dev *dev = ctx->dev;
        const struct s5p_mfc_regs *mfc_regs = dev->mfc_regs;
-       struct s5p_mfc_enc_params *p = &ctx->enc_params;
+       const struct s5p_mfc_enc_params *p = &ctx->enc_params;
        unsigned int reg = 0;
 
        mfc_debug_enter();
@@ -1349,8 +1349,8 @@ static int s5p_mfc_set_enc_params_mpeg4(struct s5p_mfc_ctx *ctx)
 {
        struct s5p_mfc_dev *dev = ctx->dev;
        const struct s5p_mfc_regs *mfc_regs = dev->mfc_regs;
-       struct s5p_mfc_enc_params *p = &ctx->enc_params;
-       struct s5p_mfc_mpeg4_enc_params *p_mpeg4 = &p->codec.mpeg4;
+       const struct s5p_mfc_enc_params *p = &ctx->enc_params;
+       const struct s5p_mfc_mpeg4_enc_params *p_mpeg4 = &p->codec.mpeg4;
        unsigned int reg = 0;
 
        mfc_debug_enter();
@@ -1431,8 +1431,8 @@ static int s5p_mfc_set_enc_params_h263(struct s5p_mfc_ctx *ctx)
 {
        struct s5p_mfc_dev *dev = ctx->dev;
        const struct s5p_mfc_regs *mfc_regs = dev->mfc_regs;
-       struct s5p_mfc_enc_params *p = &ctx->enc_params;
-       struct s5p_mfc_mpeg4_enc_params *p_h263 = &p->codec.mpeg4;
+       const struct s5p_mfc_enc_params *p = &ctx->enc_params;
+       const struct s5p_mfc_mpeg4_enc_params *p_h263 = &p->codec.mpeg4;
        unsigned int reg = 0;
 
        mfc_debug_enter();
@@ -1501,8 +1501,8 @@ static int s5p_mfc_set_enc_params_vp8(struct s5p_mfc_ctx *ctx)
 {
        struct s5p_mfc_dev *dev = ctx->dev;
        const struct s5p_mfc_regs *mfc_regs = dev->mfc_regs;
-       struct s5p_mfc_enc_params *p = &ctx->enc_params;
-       struct s5p_mfc_vp8_enc_params *p_vp8 = &p->codec.vp8;
+       const struct s5p_mfc_enc_params *p = &ctx->enc_params;
+       const struct s5p_mfc_vp8_enc_params *p_vp8 = &p->codec.vp8;
        unsigned int reg = 0;
        unsigned int val = 0;
 
@@ -1897,8 +1897,8 @@ static int s5p_mfc_h264_set_aso_slice_order_v6(struct s5p_mfc_ctx *ctx)
 {
        struct s5p_mfc_dev *dev = ctx->dev;
        const struct s5p_mfc_regs *mfc_regs = dev->mfc_regs;
-       struct s5p_mfc_enc_params *p = &ctx->enc_params;
-       struct s5p_mfc_h264_enc_params *p_h264 = &p->codec.h264;
+       const struct s5p_mfc_enc_params *p = &ctx->enc_params;
+       const struct s5p_mfc_h264_enc_params *p_h264 = &p->codec.h264;
        int i;
 
        if (p_h264->aso) {