Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a874a170 authored by Tiffany Lin's avatar Tiffany Lin Committed by Mauro Carvalho Chehab
Browse files

[media] mtk-vcodec: fix sparse warning



This patch fix sparse warning when running with parameters:
C=2 CF="-D__CHECK_ENDIAN__"

Signed-off-by: default avatarTiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: default avatarPoChun Lin <pochun.lin@mediatek.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 35697a0d
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -252,13 +252,18 @@ static int vp8_enc_compose_one_frame(struct venc_vp8_inst *inst,
	u32 bs_hdr_len;
	u32 bs_hdr_len;
	unsigned int ac_tag_size;
	unsigned int ac_tag_size;
	u8 ac_tag[MAX_AC_TAG_SIZE];
	u8 ac_tag[MAX_AC_TAG_SIZE];
	u32 tag;


	bs_frm_size = vp8_enc_read_reg(inst, VENC_BITSTREAM_FRAME_SIZE);
	bs_frm_size = vp8_enc_read_reg(inst, VENC_BITSTREAM_FRAME_SIZE);
	bs_hdr_len = vp8_enc_read_reg(inst, VENC_BITSTREAM_HEADER_LEN);
	bs_hdr_len = vp8_enc_read_reg(inst, VENC_BITSTREAM_HEADER_LEN);


	/* if a frame is key frame, not_key is 0 */
	/* if a frame is key frame, not_key is 0 */
	not_key = !inst->vpu_inst.is_key_frm;
	not_key = !inst->vpu_inst.is_key_frm;
	*(u32 *)ac_tag = __cpu_to_le32((bs_hdr_len << 5) | 0x10 | not_key);
	tag = (bs_hdr_len << 5) | 0x10 | not_key;
	ac_tag[0] = tag & 0xff;
	ac_tag[1] = (tag >> 8) & 0xff;
	ac_tag[2] = (tag >> 16) & 0xff;

	/* key frame */
	/* key frame */
	if (not_key == 0) {
	if (not_key == 0) {
		ac_tag_size = MAX_AC_TAG_SIZE;
		ac_tag_size = MAX_AC_TAG_SIZE;