From patchwork Fri Oct 21 13:59:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 9389233 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 3B4EA60762 for ; Fri, 21 Oct 2016 14:02:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AAE22A223 for ; Fri, 21 Oct 2016 14:02:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D5712A22F; Fri, 21 Oct 2016 14:02:28 +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 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 635C32A223 for ; Fri, 21 Oct 2016 14:02:24 +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 1bxaNV-0005Rk-4b; Fri, 21 Oct 2016 14:00:57 +0000 Received: from 177.205.67.60.dynamic.adsl.gvt.net.br ([177.205.67.60] helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.85_2 #1 (Red Hat Linux)) id 1bxaMx-0004lQ-2n; Fri, 21 Oct 2016 14:00:23 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.87) (envelope-from ) id 1bxaLv-0004gt-Vo; Fri, 21 Oct 2016 11:59:19 -0200 From: Mauro Carvalho Chehab To: Subject: [PATCH 1/4] mtk_mdp_vpu: fix build with COMPILE_TEST for 32 bits Date: Fri, 21 Oct 2016 11:59:16 -0200 Message-Id: X-Mailer: git-send-email 2.7.4 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Minghsiu Tsai , Mauro Carvalho Chehab , Mauro Carvalho Chehab , Hans Verkuil , Matthias Brugger , linux-mediatek@lists.infradead.org, Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, Linux Media Mailing List MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When building on i386 in 32 bits, several new warnings appear: drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c: In function 'mtk_mdp_vpu_handle_init_ack': drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c:28:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] struct mtk_mdp_vpu *vpu = (struct mtk_mdp_vpu *)msg->ap_inst; ^ drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c: In function 'mtk_mdp_vpu_ipi_handler': drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c:40:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] struct mtk_mdp_vpu *vpu = (struct mtk_mdp_vpu *)msg->ap_inst; ^ drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c: In function 'mtk_mdp_vpu_send_ap_ipi': drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c:111:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] msg.ap_inst = (uint64_t)vpu; ^ drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c: In function 'mtk_mdp_vpu_init': drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c:129:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] msg.ap_inst = (uint64_t)vpu; ^ That's because the driver assumes that it will be built only on 64 bits. As we don't want extra warnings when building with 32 bits, we need to double-cast. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c b/drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c index fb07bf3dbd8b..b38d29e99f7a 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c @@ -25,7 +25,7 @@ static inline struct mtk_mdp_ctx *vpu_to_ctx(struct mtk_mdp_vpu *vpu) static void mtk_mdp_vpu_handle_init_ack(struct mdp_ipi_comm_ack *msg) { - struct mtk_mdp_vpu *vpu = (struct mtk_mdp_vpu *)msg->ap_inst; + struct mtk_mdp_vpu *vpu = (struct mtk_mdp_vpu *)(long)msg->ap_inst; /* mapping VPU address to kernel virtual address */ vpu->vsi = (struct mdp_process_vsi *) @@ -37,7 +37,7 @@ static void mtk_mdp_vpu_ipi_handler(void *data, unsigned int len, void *priv) { unsigned int msg_id = *(unsigned int *)data; struct mdp_ipi_comm_ack *msg = (struct mdp_ipi_comm_ack *)data; - struct mtk_mdp_vpu *vpu = (struct mtk_mdp_vpu *)msg->ap_inst; + struct mtk_mdp_vpu *vpu = (struct mtk_mdp_vpu *)(long)msg->ap_inst; struct mtk_mdp_ctx *ctx; vpu->failure = msg->status; @@ -108,7 +108,7 @@ static int mtk_mdp_vpu_send_ap_ipi(struct mtk_mdp_vpu *vpu, uint32_t msg_id) msg.msg_id = msg_id; msg.ipi_id = IPI_MDP; msg.vpu_inst_addr = vpu->inst_addr; - msg.ap_inst = (uint64_t)vpu; + msg.ap_inst = (uint64_t)(long)vpu; err = mtk_mdp_vpu_send_msg((void *)&msg, sizeof(msg), vpu, IPI_MDP); if (!err && vpu->failure) err = -EINVAL; @@ -126,7 +126,7 @@ int mtk_mdp_vpu_init(struct mtk_mdp_vpu *vpu) msg.msg_id = AP_MDP_INIT; msg.ipi_id = IPI_MDP; - msg.ap_inst = (uint64_t)vpu; + msg.ap_inst = (uint64_t)(long)vpu; err = mtk_mdp_vpu_send_msg((void *)&msg, sizeof(msg), vpu, IPI_MDP); if (!err && vpu->failure) err = -EINVAL;