From patchwork Wed Sep 7 06:18:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "tiffany.lin" X-Patchwork-Id: 9318243 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A7D77601C0 for ; Wed, 7 Sep 2016 06:19:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 974362903A for ; Wed, 7 Sep 2016 06:19:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B41C2903C; Wed, 7 Sep 2016 06:19:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1E80C2903A for ; Wed, 7 Sep 2016 06:19:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bhWCV-0002Ii-Q1; Wed, 07 Sep 2016 06:19:11 +0000 Received: from [210.61.82.184] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bhWCS-0002B6-Bx for linux-mediatek@lists.infradead.org; Wed, 07 Sep 2016 06:19:10 +0000 Received: from mtkhts09.mediatek.inc [(172.21.101.70)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 864190478; Wed, 07 Sep 2016 14:18:42 +0800 Received: from localhost.localdomain (10.21.14.115) by mtkhts09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 14.3.266.1; Wed, 7 Sep 2016 14:18:40 +0800 From: Tiffany Lin To: Hans Verkuil , Laurent Pinchart , Mauro Carvalho Chehab , Matthias Brugger , Daniel Kurtz , Pawel Osciak Subject: [PATCH] vcodec: mediatek: Fix decoder compiler/sparse warnings Date: Wed, 7 Sep 2016 14:18:39 +0800 Message-ID: <1473229119-5706-1-git-send-email-tiffany.lin@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160906_231909_053457_FFDF94E6 X-CRM114-Status: GOOD ( 12.81 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tiffany Lin , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Yingjoe Chen , Eddie Huang , linux-media@vger.kernel.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fix decoder compiler/sparse warnings Signed-off-by: Tiffany Lin --- .../media/platform/mtk-vcodec/vdec/vdec_h264_if.c | 7 ++++--- .../media/platform/mtk-vcodec/vdec/vdec_vp8_if.c | 1 + .../media/platform/mtk-vcodec/vdec/vdec_vp9_if.c | 4 ++-- drivers/media/platform/mtk-vcodec/vdec_vpu_if.c | 6 ++++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c index 0353a47..57a842f 100644 --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c @@ -239,7 +239,7 @@ static void put_fb_to_free(struct vdec_h264_inst *inst, struct vdec_fb *fb) mtk_vcodec_debug(inst, "[FB] put fb into free_list @(%p, %llx)", fb->base_y.va, (u64)fb->base_y.dma_addr); - list->fb_list[list->write_idx].vdec_fb_va = (u64)fb; + list->fb_list[list->write_idx].vdec_fb_va = (u64)(uintptr_t)fb; list->write_idx = (list->write_idx == H264_MAX_FB_NUM - 1) ? 0 : list->write_idx + 1; list->count++; @@ -350,7 +350,7 @@ static int vdec_h264_decode(unsigned long h_vdec, struct mtk_vcodec_mem *bs, unsigned char *buf; unsigned int buf_sz; unsigned int data[2]; - uint64_t vdec_fb_va = (u64)fb; + uint64_t vdec_fb_va = (u64)(uintptr_t)fb; uint64_t y_fb_dma = fb ? (u64)fb->base_y.dma_addr : 0; uint64_t c_fb_dma = fb ? (u64)fb->base_c.dma_addr : 0; @@ -443,7 +443,8 @@ static void vdec_h264_get_fb(struct vdec_h264_inst *inst, return; } - fb = (struct vdec_fb *)list->fb_list[list->read_idx].vdec_fb_va; + fb = (struct vdec_fb *) + (uintptr_t)list->fb_list[list->read_idx].vdec_fb_va; fb->status |= (disp_list ? FB_ST_DISPLAY : FB_ST_FREE); *out_fb = fb; diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c index d4fce3e..054d4d1 100644 --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c @@ -13,6 +13,7 @@ * GNU General Public License for more details. */ +#include #include "../vdec_drv_if.h" #include "../mtk_vcodec_util.h" #include "../mtk_vcodec_dec.h" diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c index 60a7b00..ca3174d 100644 --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c @@ -475,7 +475,7 @@ static void vp9_swap_frm_bufs(struct vdec_vp9_inst *inst) */ if (frm_to_show->fb != NULL) mtk_vcodec_err(inst, - "inst->cur_fb->base_y.size=%lx, frm_to_show->fb.base_y.size=%lx", + "inst->cur_fb->base_y.size=%zu, frm_to_show->fb.base_y.size=%zu", inst->cur_fb->base_y.size, frm_to_show->fb->base_y.size); } @@ -791,7 +791,7 @@ static int vdec_vp9_decode(unsigned long h_vdec, struct mtk_vcodec_mem *bs, return -EINVAL; } - mtk_vcodec_debug(inst, "Input BS Size = %ld", bs->size); + mtk_vcodec_debug(inst, "Input BS Size = %zu", bs->size); while (1) { struct vdec_fb *cur_fb = NULL; diff --git a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c index 0798a6b..5a24c51 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c @@ -19,7 +19,8 @@ static void handle_init_ack_msg(struct vdec_vpu_ipi_init_ack *msg) { - struct vdec_vpu_inst *vpu = (struct vdec_vpu_inst *)msg->ap_inst_addr; + struct vdec_vpu_inst *vpu = (struct vdec_vpu_inst *) + (unsigned long)msg->ap_inst_addr; mtk_vcodec_debug(vpu, "+ ap_inst_addr = 0x%llx", msg->ap_inst_addr); @@ -38,7 +39,8 @@ static void handle_init_ack_msg(struct vdec_vpu_ipi_init_ack *msg) void vpu_dec_ipi_handler(void *data, unsigned int len, void *priv) { struct vdec_vpu_ipi_ack *msg = data; - struct vdec_vpu_inst *vpu = (struct vdec_vpu_inst *)msg->ap_inst_addr; + struct vdec_vpu_inst *vpu = (struct vdec_vpu_inst *) + (unsigned long)msg->ap_inst_addr; mtk_vcodec_debug(vpu, "+ id=%X", msg->msg_id);