From patchwork Thu Dec 6 00:32:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 1008557 X-Patchwork-Delegate: lukma@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=theobroma-systems.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 439Gn34qsbz9s3Z for ; Thu, 6 Dec 2018 11:33:55 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id AC888C2204D; Thu, 6 Dec 2018 00:33:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5F40DC21E7D; Thu, 6 Dec 2018 00:32:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2981CC21E7D; Thu, 6 Dec 2018 00:32:58 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id 38D66C21DFB for ; Thu, 6 Dec 2018 00:32:54 +0000 (UTC) Received: from [86.59.122.178] (port=36097 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1gUhb3-0000bh-At; Thu, 06 Dec 2018 01:32:53 +0100 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Thu, 6 Dec 2018 01:32:47 +0100 Message-Id: <1544056367-9255-1-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 Cc: Marek Vasut Subject: [U-Boot] [PATCH] usb: dwc2-otg: make regs_phy (in platdata) a uintptr_t X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The regs_phy field of the platform data structure for dwc2-otg is today declared an unsigned int, but will eventually be cast into a void* for a writel operation. This triggers errors on modern GCC versions. E.g. we get the following error with GCC 6.3: drivers/usb/phy/rockchip_usb2_phy.c: In function 'property_enable': arch/arm/include/asm/io.h:49:29: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] #define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v)) ^ arch/arm/include/asm/io.h:117:48: note: in expansion of macro '__arch_putl' #define writel(v,c) ({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; }) ^~~~~~~~~~~ drivers/usb/phy/rockchip_usb2_phy.c:61:2: note: in expansion of macro 'writel' writel(val, pdata->regs_phy + reg->offset); ^~~~~~ This commit changes regs_phy to be a uintptr_t to ensure that it is large enough to hold any valid pointer (and fix the associated warning). Signed-off-by: Philipp Tomsich Acked-by: Marek Vasut --- include/usb/dwc2_udc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/usb/dwc2_udc.h b/include/usb/dwc2_udc.h index 62e3236..4068de0 100644 --- a/include/usb/dwc2_udc.h +++ b/include/usb/dwc2_udc.h @@ -14,7 +14,7 @@ struct dwc2_plat_otg_data { void *priv; int phy_of_node; int (*phy_control)(int on); - unsigned int regs_phy; + uintptr_t regs_phy; uintptr_t regs_otg; unsigned int usb_phy_ctrl; unsigned int usb_flags;