* [PATCH] [media] vcodec: mediatek: fix sparse warning
@ 2016-05-11 8:21 Tiffany Lin
0 siblings, 0 replies; only message in thread
From: Tiffany Lin @ 2016-05-11 8:21 UTC (permalink / raw)
To: Hans Verkuil, Mauro Carvalho Chehab, Matthias Brugger,
Daniel Kurtz, Pawel Osciak
Cc: Eddie Huang, Yingjoe Chen, linux-kernel, linux-media,
linux-mediatek, Tiffany.lin, Tiffany Lin, PoChun Lin
This patch fix sparse warning when running with parameters:
C=2 CF="-D__CHECK_ENDIAN__"
Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: PoChun Lin <pochun.lin@mediatek.com>
---
.../media/platform/mtk-vcodec/venc/venc_vp8_if.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
index 431ae70..5b4ef0f 100644
--- a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
+++ b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
@@ -252,13 +252,18 @@ static int vp8_enc_compose_one_frame(struct venc_vp8_inst *inst,
u32 bs_hdr_len;
unsigned int 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_hdr_len = vp8_enc_read_reg(inst, VENC_BITSTREAM_HEADER_LEN);
/* if a frame is key frame, not_key is 0 */
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 */
if (not_key == 0) {
ac_tag_size = MAX_AC_TAG_SIZE;
--
1.7.9.5
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-05-11 8:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-11 8:21 [PATCH] [media] vcodec: mediatek: fix sparse warning Tiffany Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®