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: 9318239 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 C3FFB6077F for ; Wed, 7 Sep 2016 06:18:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4FA229038 for ; Wed, 7 Sep 2016 06:18:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9A072903B; Wed, 7 Sep 2016 06:18:55 +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=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5B2829038 for ; Wed, 7 Sep 2016 06:18:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753511AbcIGGSw (ORCPT ); Wed, 7 Sep 2016 02:18:52 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:39966 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751021AbcIGGSu (ORCPT ); Wed, 7 Sep 2016 02:18:50 -0400 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 CC: Eddie Huang , Yingjoe Chen , , , , , Tiffany Lin 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 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.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);