media: s5p-mfc: constify s5p_mfc_hw_ops structures
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sun, 24 Dec 2023 15:44:07 +0000 (16:44 +0100)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 22 Jan 2024 11:16:43 +0000 (12:16 +0100)
Static "s5p_mfc_hw_ops" structures are not modified by the driver, so
they can be made const for code safety.

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_common.h
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.h
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h

index fd43c58848d45e81f785195aa6c38dd4b5aadbe3..4457dacc3c9c70b65f329884114a19cd9655c4bd 100644 (file)
@@ -340,7 +340,7 @@ struct s5p_mfc_dev {
 
        struct s5p_mfc_priv_buf ctx_buf;
        int warn_start;
-       struct s5p_mfc_hw_ops *mfc_ops;
+       const struct s5p_mfc_hw_ops *mfc_ops;
        const struct s5p_mfc_hw_cmds *mfc_cmds;
        const struct s5p_mfc_regs *mfc_regs;
        enum s5p_mfc_fw_ver fw_ver;
index 37293e833b625546a865032dfd445ae0a46d5b12..7a322c80f7c1380ae7df8dee9c98605c397644d3 100644 (file)
@@ -1593,7 +1593,7 @@ static unsigned int s5p_mfc_get_crop_info_v_v5(struct s5p_mfc_ctx *ctx)
 }
 
 /* Initialize opr function pointers for MFC v5 */
-static struct s5p_mfc_hw_ops s5p_mfc_ops_v5 = {
+static const struct s5p_mfc_hw_ops s5p_mfc_ops_v5 = {
        .alloc_dec_temp_buffers = s5p_mfc_alloc_dec_temp_buffers_v5,
        .release_dec_desc_buffer = s5p_mfc_release_dec_desc_buffer_v5,
        .alloc_codec_buffers = s5p_mfc_alloc_codec_buffers_v5,
@@ -1633,7 +1633,7 @@ static struct s5p_mfc_hw_ops s5p_mfc_ops_v5 = {
        .get_crop_info_v = s5p_mfc_get_crop_info_v_v5,
 };
 
-struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v5(void)
+const struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v5(void)
 {
        return &s5p_mfc_ops_v5;
 }
index b53d376ead603b30f5c08d5cf1496769d6b40f74..0b98c619676e44253ca4bb1cf8fc966a0287fb9e 100644 (file)
@@ -78,5 +78,5 @@ enum MFC_SHM_OFS {
        FRAME_PACK_SEI_INFO     = 0x17c, /* E */
 };
 
-struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v5(void);
+const struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v5(void);
 #endif /* S5P_MFC_OPR_H_ */
index 2573f101838c31d8f3c1078f0f54eaad64c4e279..07a999bd127f949393fcf2189e332016b823d52c 100644 (file)
@@ -2657,7 +2657,7 @@ done:
 }
 
 /* Initialize opr function pointers for MFC v6 */
-static struct s5p_mfc_hw_ops s5p_mfc_ops_v6 = {
+static const struct s5p_mfc_hw_ops s5p_mfc_ops_v6 = {
        .alloc_dec_temp_buffers = s5p_mfc_alloc_dec_temp_buffers_v6,
        .release_dec_desc_buffer = s5p_mfc_release_dec_desc_buffer_v6,
        .alloc_codec_buffers = s5p_mfc_alloc_codec_buffers_v6,
@@ -2701,7 +2701,7 @@ static struct s5p_mfc_hw_ops s5p_mfc_ops_v6 = {
        .get_e_min_scratch_buf_size = s5p_mfc_get_e_min_scratch_buf_size,
 };
 
-struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v6(void)
+const struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v6(void)
 {
        return &s5p_mfc_ops_v6;
 }
index 94ecb0e6e7c73b096a8fc4df859110cd73a0cf51..7fc1307675d8d43a066157c4a55f23e612955a92 100644 (file)
@@ -51,6 +51,6 @@
 
 #define FRAME_DELTA_DEFAULT            1
 
-struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v6(void);
+const struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v6(void);
 const struct s5p_mfc_regs *s5p_mfc_init_regs_v6_plus(struct s5p_mfc_dev *dev);
 #endif /* S5P_MFC_OPR_V6_H_ */