mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tiffany Lin <tiffany.lin@mediatek.com>
To: Hans Verkuil <hans.verkuil@cisco.com>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Daniel Kurtz <djkurtz@chromium.org>,
	Pawel Osciak <posciak@chromium.org>
Cc: Eddie Huang <eddie.huang@mediatek.com>,
	Yingjoe Chen <yingjoe.chen@mediatek.com>,
	<linux-kernel@vger.kernel.org>, <linux-media@vger.kernel.org>,
	<linux-mediatek@lists.infradead.org>, <Tiffany.lin@mediatek.com>,
	Tiffany Lin <tiffany.lin@mediatek.com>,
	PoChun Lin <pochun.lin@mediatek.com>
Subject: [PATCH] [media] vcodec: mediatek: fix sparse warning
Date: Wed, 11 May 2016 16:21:45 +0800	[thread overview]
Message-ID: <1462954905-33600-1-git-send-email-tiffany.lin@mediatek.com> (raw)

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

                 reply	other threads:[~2016-05-11  8:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462954905-33600-1-git-send-email-tiffany.lin@mediatek.com \
    --to=tiffany.lin@mediatek.com \
    --cc=djkurtz@chromium.org \
    --cc=eddie.huang@mediatek.com \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@osg.samsung.com \
    --cc=pochun.lin@mediatek.com \
    --cc=posciak@chromium.org \
    --cc=yingjoe.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®