From patchwork Thu Apr 12 15:24:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10338859 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 2C685602D8 for ; Thu, 12 Apr 2018 15:24:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FDA527CEE for ; Thu, 12 Apr 2018 15:24:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1436027DA4; Thu, 12 Apr 2018 15:24:43 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 EB9BA27CEE for ; Thu, 12 Apr 2018 15:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753984AbeDLPYc (ORCPT ); Thu, 12 Apr 2018 11:24:32 -0400 Received: from osg.samsung.com ([64.30.133.232]:34295 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753954AbeDLPYa (ORCPT ); Thu, 12 Apr 2018 11:24:30 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 353821CFE7; Thu, 12 Apr 2018 08:24:30 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8GLdRjB8eRaQ; Thu, 12 Apr 2018 08:24:29 -0700 (PDT) Received: from smtp.s-opensource.com (unknown [179.179.40.138]) by osg.samsung.com (Postfix) with ESMTPSA id 682281CF46; Thu, 12 Apr 2018 08:24:13 -0700 (PDT) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.90_1) (envelope-from ) id 1f6e55-0005SP-6I; Thu, 12 Apr 2018 11:24:11 -0400 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Laurent Pinchart , Al Viro , Hans Verkuil , Bhumika Goyal , Kees Cook , Markus Elfring , Peter Ujfalusi , Arnd Bergmann , Sakari Ailus Subject: [PATCH 09/17] media: platform: fix some 64-bits warnings Date: Thu, 12 Apr 2018 11:24:01 -0400 Message-Id: <04fe60ef9cdd0c046a7d0dab0ac4e1caeec33895.1523546545.git.mchehab@s-opensource.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: To: unlisted-recipients:; (no To-header on input) 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 The omap/omap3 and viu drivers are for 32 bit platforms only. There, a pointer has 32 bits. Now that those drivers build for 64 bits with COMPILE_TEST, they produce the following warnings: drivers/media/platform/omap/omap_vout_vrfb.c: In function 'omap_vout_allocate_vrfb_buffers': drivers/media/platform/omap/omap_vout_vrfb.c:57:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memset((void *) vout->smsshado_virt_addr[i], 0, ^ drivers/media/platform/fsl-viu.c: In function 'viu_setup_preview': drivers/media/platform/fsl-viu.c:753:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] reg_val.field_base_addr = (u32)dev->ovbuf.base; ^ drivers/media/platform/omap/omap_vout.c: In function 'omap_vout_get_userptr': drivers/media/platform/omap/omap_vout.c:209:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] *physp = virt_to_phys((void *)virtp); ^ drivers/media/platform/omap3isp/ispccdc.c: In function 'ccdc_config': drivers/media/platform/omap3isp/ispccdc.c:738:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (__force void __user *)fpc.fpcaddr, ^ Add some typecasts to remove those warnings when building for 64 bits. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/fsl-viu.c | 2 +- drivers/media/platform/omap/omap_vout.c | 2 +- drivers/media/platform/omap/omap_vout_vrfb.c | 4 ++-- drivers/media/platform/omap3isp/ispccdc.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c index 5b6bfcafc2a4..e41510ce69a4 100644 --- a/drivers/media/platform/fsl-viu.c +++ b/drivers/media/platform/fsl-viu.c @@ -750,7 +750,7 @@ static int viu_setup_preview(struct viu_dev *dev, struct viu_fh *fh) reg_val.status_cfg |= DMA_ACT | INT_DMA_END_EN | INT_FIELD_EN; /* setup the base address of the overlay buffer */ - reg_val.field_base_addr = (u32)dev->ovbuf.base; + reg_val.field_base_addr = (u32)(long)dev->ovbuf.base; return 0; } diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c index e2723fedac8d..5700b7818621 100644 --- a/drivers/media/platform/omap/omap_vout.c +++ b/drivers/media/platform/omap/omap_vout.c @@ -198,7 +198,7 @@ static int omap_vout_try_format(struct v4l2_pix_format *pix) * omap_vout_get_userptr: Convert user space virtual address to physical * address. */ -static int omap_vout_get_userptr(struct videobuf_buffer *vb, u32 virtp, +static int omap_vout_get_userptr(struct videobuf_buffer *vb, long virtp, u32 *physp) { struct frame_vector *vec; diff --git a/drivers/media/platform/omap/omap_vout_vrfb.c b/drivers/media/platform/omap/omap_vout_vrfb.c index 1d8508237220..29e3f5da59c1 100644 --- a/drivers/media/platform/omap/omap_vout_vrfb.c +++ b/drivers/media/platform/omap/omap_vout_vrfb.c @@ -54,8 +54,8 @@ static int omap_vout_allocate_vrfb_buffers(struct omap_vout_device *vout, *count = 0; return -ENOMEM; } - memset((void *) vout->smsshado_virt_addr[i], 0, - vout->smsshado_size); + memset((void *)(long)vout->smsshado_virt_addr[i], 0, + vout->smsshado_size); } return 0; } diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c index b66276ab5765..77b73e27a274 100644 --- a/drivers/media/platform/omap3isp/ispccdc.c +++ b/drivers/media/platform/omap3isp/ispccdc.c @@ -735,7 +735,7 @@ static int ccdc_config(struct isp_ccdc_device *ccdc, return -ENOMEM; if (copy_from_user(fpc_new.addr, - (__force void __user *)fpc.fpcaddr, + (__force void __user *)(long)fpc.fpcaddr, size)) { dma_free_coherent(isp->dev, size, fpc_new.addr, fpc_new.dma);