From patchwork Fri Dec 18 15:33:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7886701 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2D8F49F1AF for ; Fri, 18 Dec 2015 15:36:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5884F20480 for ; Fri, 18 Dec 2015 15:36:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E46320437 for ; Fri, 18 Dec 2015 15:36:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932564AbbLRPef (ORCPT ); Fri, 18 Dec 2015 10:34:35 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:50765 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754331AbbLRPed (ORCPT ); Fri, 18 Dec 2015 10:34:33 -0500 Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue005) with ESMTPSA (Nemesis) id 0Lu05i-1aIMlu3W22-011RuF; Fri, 18 Dec 2015 16:33:56 +0100 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-sh@vger.kernel.org, linux-usb@vger.kernel.org, Magnus Damm , linux-kernel@vger.kernel.org, Felipe Balbi , Simon Horman , linux-arm-kernel@lists.infradead.org Subject: [PATCH RESENT] staging/emxx_udc: fix 64-bit warnings Date: Fri, 18 Dec 2015 16:33:51 +0100 Message-ID: <2183225.RrE6ZdDul9@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:uJhlA1JpPQN+rOisle/WL5M+pIZeFBbMDFrM7+FDM6w7K+BcNLV 2qU6PAXae+OFT2AI1vCzTAv8U96/Xt8ECs3evrZQflT6du1fkD8sEKvoYy64zkfvu/mJJh8 cuVfU6FQhqc8muXqlaV4CxG7I+Ywn9JKMs0rShLSsBAg5UcRKrmQ9jzlCfZouNSYANg/h7N qhpT+B0HH+swj44jG8neQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:N2Mu1mYBRIY=:ZmoeLGvLhNtAyW3O77tiWC 19PbGd0mIhNz7xRNBMFHTad/dsMq7/c+BuZZQVyNJZk7VX5I9i+53UlEGd5IlVyMpXNBCF0P7 eq1U74E45JqcBneNIz79QTSpXHAq0YwBuNUQcpQh/Te8qGBvflUHs/wbFfuQoQXdv1ojcTWuJ sHgzEEasBCSGJf4LnzPCrqhTJwXisavr0a+OueR/Noox10Iep0uIOcvJYqErL9dVfbCUtyK05 oYytS1zET8MoS7a/SdaqkR0hxYg1DY4GX6dUWR7RSSqBwLTNehAr8fORJtENtrB7enR6UFbQW 2D6yrMa36vhXiQAtRmU68/Uxq0FmhQFhWjUyhYnq58HfiO7+khNIQNFrKUk8hbP3ywhBDAKPv Bzoae6cvlEVcDv4jZzzYMe59BBR7+nnPqTbRD3TQ6IRHpunmgV8WcAxPNdi8FyJCqOEkNtXqO sYAyZot8roNelaBQxLULw3DKVDXYTg0GXxOxtBwcNOC2VISg4rADh4EFmW8FYZxMiPbgLdZao Fdxzj/mekSa1mC0fdLMuxQfeDZbp1bRJBpauXBcej2WMaEj/CKiFh+gygqDaMhKN1G6u1oBa8 N8cJ6P/TOi8c40/XqtKzAxLhtb1zrOIPVOazscR3MZWZuqflLSvaYJR84ivX3LH9O8TqS3eWE Ius5bLZvqCY2mvrJdfS84AziLQTdmPpfoSeuSIGHdkM1zSO/chHyes3zxItaA1u9f73dU9Wjh vsVpooUpvzJWAEww Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ARCH_SHMOBILE is coming to arm64, which creates new warnings in allmodconfig: drivers/staging/emxx_udc/emxx_udc.c: In function '_nbu2ss_out_dma': drivers/staging/emxx_udc/emxx_udc.c:843:45: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] _nbu2ss_writel(&preg->EP_DCR[num].EP_TADR, (u32)pBuffer); This is clearly a mistake from confusing a dma_addr_t with a pointer, so the fix is to use the correct types in two places. The third warning of this kind is a check for an unaligned pointer, which should be done by casting the pointer to uintptr_t, not int. Signed-off-by: Arnd Bergmann --- I sent this a month ago, here is the same patch again in case it got lost. -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index 4e6c16af40fc..c168845cbb91 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -823,7 +823,7 @@ static int _nbu2ss_out_dma( u32 length ) { - u8 *pBuffer; + dma_addr_t pBuffer; u32 mpkt; u32 lmpkt; u32 dmacnt; @@ -836,7 +836,7 @@ static int _nbu2ss_out_dma( return 1; /* DMA is forwarded */ req->dma_flag = TRUE; - pBuffer = (u8 *)req->req.dma; + pBuffer = req->req.dma; pBuffer += req->req.actual; /* DMA Address */ @@ -1034,7 +1034,7 @@ static int _nbu2ss_in_dma( u32 length ) { - u8 *pBuffer; + dma_addr_t pBuffer; u32 mpkt; /* MaxPacketSize */ u32 lmpkt; /* Last Packet Data Size */ u32 dmacnt; /* IN Data Size */ @@ -1080,7 +1080,7 @@ static int _nbu2ss_in_dma( _nbu2ss_writel(&preg->EP_DCR[num].EP_DCR2, data); /* Address setting */ - pBuffer = (u8 *)req->req.dma; + pBuffer = req->req.dma; pBuffer += req->req.actual; _nbu2ss_writel(&preg->EP_DCR[num].EP_TADR, (u32)pBuffer); @@ -2728,7 +2728,7 @@ static int nbu2ss_ep_queue( spin_lock_irqsave(&udc->lock, flags); #ifdef USE_DMA - if ((u32)req->req.buf & 0x3) + if ((uintptr_t)req->req.buf & 0x3) req->unaligned = TRUE; else req->unaligned = FALSE;