lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 23 Aug 2017 15:49:57 +0200
From:   John Crispin <john@...ozen.org>
To:     Arnd Bergmann <arnd@...db.de>,
        Kishon Vijay Abraham I <kishon@...com>
Cc:     Harvey Hunt <harvey.hunt@...tec.com>, linux-kernel@...r.kernel.org,
        gregkh@...uxfoundation.org
Subject: Re: [PATCH] phy: ralink: fix 64-bit build warning



On 23/08/17 15:39, 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 <arnd@...db.de>
Acked-by: John Crispin <john@...ozen.org>

gregkh: can you fold this into the commit sitting inside usb-next ?



> ---
>   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");

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ