From patchwork Wed Nov 18 21:02:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7652661 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BBB88BF90C for ; Wed, 18 Nov 2015 21:03:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DCA6B20497 for ; Wed, 18 Nov 2015 21:03:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DCD2320483 for ; Wed, 18 Nov 2015 21:03:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754713AbbKRVDZ (ORCPT ); Wed, 18 Nov 2015 16:03:25 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:56745 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754683AbbKRVDY (ORCPT ); Wed, 18 Nov 2015 16:03:24 -0500 Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0LbIy2-1afLB81Dxq-00kvnC; Wed, 18 Nov 2015 22:02:44 +0100 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org, Felipe Balbi , linux-usb@vger.kernel.org, devel@driverdev.osuosl.org, Magnus Damm , Simon Horman Subject: [PATCH] staging/emxx_udc: fix 64-bit warnings Date: Wed, 18 Nov 2015 22:02:39 +0100 Message-ID: <4127718.gSaDyyMLEa@wuerfel> User-Agent: KMail/4.11.5 (Linux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bN7cmT6D377xw Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 --- 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;