[media] mtk-vcodec: constify venc_common_if structures
authorJulia Lawall <Julia.Lawall@lip6.fr>
Tue, 9 Aug 2016 16:03:55 +0000 (13:03 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 24 Aug 2016 11:46:19 +0000 (08:46 -0300)
The venc_common_if structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c
drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
drivers/media/platform/mtk-vcodec/venc_drv_if.c

index 94f0a425be42e93fe72979f242d8e68c6a7f5c62..b0cb3ed7958598c50c503fed7cb0b9856f60d006 100644 (file)
@@ -240,7 +240,7 @@ struct mtk_vcodec_ctx {
        enum mtk_encode_param param_change;
        struct mtk_enc_params enc_params;
 
-       struct venc_common_if *enc_if;
+       const struct venc_common_if *enc_if;
        unsigned long drv_handle;
 
        int int_cond;
index 9a600525b3c172e100250315c772dd3df620d4ff..532cd366eee73e4498f904870898530444737cea 100644 (file)
@@ -664,16 +664,16 @@ static int h264_enc_deinit(unsigned long handle)
        return ret;
 }
 
-static struct venc_common_if venc_h264_if = {
+static const struct venc_common_if venc_h264_if = {
        h264_enc_init,
        h264_enc_encode,
        h264_enc_set_param,
        h264_enc_deinit,
 };
 
-struct venc_common_if *get_h264_enc_comm_if(void);
+const struct venc_common_if *get_h264_enc_comm_if(void);
 
-struct venc_common_if *get_h264_enc_comm_if(void)
+const struct venc_common_if *get_h264_enc_comm_if(void)
 {
        return &venc_h264_if;
 }
index 60bbcd2a051058b7a6d5698240efcd6c0881e778..bdf67808d0fecf65fb1e0b533ae57ea9eb2cc4f9 100644 (file)
@@ -471,16 +471,16 @@ static int vp8_enc_deinit(unsigned long handle)
        return ret;
 }
 
-static struct venc_common_if venc_vp8_if = {
+static const struct venc_common_if venc_vp8_if = {
        vp8_enc_init,
        vp8_enc_encode,
        vp8_enc_set_param,
        vp8_enc_deinit,
 };
 
-struct venc_common_if *get_vp8_enc_comm_if(void);
+const struct venc_common_if *get_vp8_enc_comm_if(void);
 
-struct venc_common_if *get_vp8_enc_comm_if(void)
+const struct venc_common_if *get_vp8_enc_comm_if(void)
 {
        return &venc_vp8_if;
 }
index c4c83e7189c31c1f95902a484efc4241b80f7c99..d02d5f1df2792252ab628d227ba4b4cc43f427cf 100644 (file)
@@ -26,8 +26,8 @@
 #include "mtk_vcodec_enc_pm.h"
 #include "mtk_vpu.h"
 
-struct venc_common_if *get_h264_enc_comm_if(void);
-struct venc_common_if *get_vp8_enc_comm_if(void);
+const struct venc_common_if *get_h264_enc_comm_if(void);
+const struct venc_common_if *get_vp8_enc_comm_if(void);
 
 int venc_if_init(struct mtk_vcodec_ctx *ctx, unsigned int fourcc)
 {