Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932131AbdHWOWB (ORCPT ); Wed, 23 Aug 2017 10:22:01 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:10964 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754066AbdHWOWA (ORCPT ); Wed, 23 Aug 2017 10:22:00 -0400 Subject: Re: [PATCH] phy: ralink: fix 64-bit build warning To: Arnd Bergmann , John Crispin , Greg Kroah-Hartman References: <20170823134019.927267-1-arnd@arndb.de> CC: Harvey Hunt , From: Kishon Vijay Abraham I Message-ID: Date: Wed, 23 Aug 2017 19:50:46 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170823134019.927267-1-arnd@arndb.de> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2315 Lines: 63 Greg, On Wednesday 23 August 2017 07:09 PM, Arnd Bergmann wrote: > Casting between an 'int' and a pointer causes a warning on > 64-bit architectures in compile-testing this driver: > > drivers/phy/ralink/phy-ralink-usb.c: In function 'ralink_usb_phy_probe': > drivers/phy/ralink/phy-ralink-usb.c:195:13: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] > > This changes the code to cast to uintptr_t instead. This is > guaranteed to do what we want on all architectures and avoids > the warning. > > Fixes: 2411a736ff09 ("phy: ralink-usb: add driver for Mediatek/Ralink") > Signed-off-by: Arnd Bergmann Can you pick this patch to fix the compiler warning. Thanks Kishon > --- > drivers/phy/ralink/phy-ralink-usb.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/phy/ralink/phy-ralink-usb.c b/drivers/phy/ralink/phy-ralink-usb.c > index d19088c0ce5c..4fea31f8ac1c 100644 > --- a/drivers/phy/ralink/phy-ralink-usb.c > +++ b/drivers/phy/ralink/phy-ralink-usb.c > @@ -160,18 +160,18 @@ static struct phy_ops ralink_usb_phy_ops = { > static const struct of_device_id ralink_usb_phy_of_match[] = { > { > .compatible = "ralink,rt3352-usbphy", > - .data = (void *) (RT_CLKCFG1_UPHY1_CLK_EN | > - RT_CLKCFG1_UPHY0_CLK_EN) > + .data = (void *)(uintptr_t)(RT_CLKCFG1_UPHY1_CLK_EN | > + RT_CLKCFG1_UPHY0_CLK_EN) > }, > { > .compatible = "mediatek,mt7620-usbphy", > - .data = (void *) (MT7620_CLKCFG1_UPHY1_CLK_EN | > - MT7620_CLKCFG1_UPHY0_CLK_EN) > + .data = (void *)(uintptr_t)(MT7620_CLKCFG1_UPHY1_CLK_EN | > + MT7620_CLKCFG1_UPHY0_CLK_EN) > }, > { > .compatible = "mediatek,mt7628-usbphy", > - .data = (void *) (MT7620_CLKCFG1_UPHY1_CLK_EN | > - MT7620_CLKCFG1_UPHY0_CLK_EN) }, > + .data = (void *)(uintptr_t)(MT7620_CLKCFG1_UPHY1_CLK_EN | > + MT7620_CLKCFG1_UPHY0_CLK_EN) }, > { }, > }; > MODULE_DEVICE_TABLE(of, ralink_usb_phy_of_match); > @@ -192,7 +192,7 @@ static int ralink_usb_phy_probe(struct platform_device *pdev) > if (!phy) > return -ENOMEM; > > - phy->clk = (u32) match->data; > + phy->clk = (uintptr_t)match->data; > phy->base = NULL; > > phy->sysctl = syscon_regmap_lookup_by_phandle(dev->of_node, "ralink,sysctl"); >