* [PATCH] phy: ralink: fix 64-bit build warning
@ 2017-08-23 13:39 Arnd Bergmann
2017-08-23 13:49 ` John Crispin
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Arnd Bergmann @ 2017-08-23 13:39 UTC (permalink / raw)
To: Kishon Vijay Abraham I, John Crispin
Cc: Arnd Bergmann, Harvey Hunt, linux-kernel
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@arndb.de>
---
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");
--
2.9.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] phy: ralink: fix 64-bit build warning
2017-08-23 13:39 [PATCH] phy: ralink: fix 64-bit build warning Arnd Bergmann
@ 2017-08-23 13:49 ` John Crispin
2017-08-23 13:58 ` Kishon Vijay Abraham I
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: John Crispin @ 2017-08-23 13:49 UTC (permalink / raw)
To: Arnd Bergmann, Kishon Vijay Abraham I; +Cc: Harvey Hunt, linux-kernel, gregkh
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@arndb.de>
Acked-by: John Crispin <john@phrozen.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");
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] phy: ralink: fix 64-bit build warning
2017-08-23 13:39 [PATCH] phy: ralink: fix 64-bit build warning Arnd Bergmann
2017-08-23 13:49 ` John Crispin
@ 2017-08-23 13:58 ` Kishon Vijay Abraham I
2017-08-23 13:59 ` Harvey Hunt
2017-08-23 14:20 ` Kishon Vijay Abraham I
3 siblings, 0 replies; 8+ messages in thread
From: Kishon Vijay Abraham I @ 2017-08-23 13:58 UTC (permalink / raw)
To: Arnd Bergmann, John Crispin; +Cc: Harvey Hunt, linux-kernel
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 <arnd@arndb.de>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
> 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");
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] phy: ralink: fix 64-bit build warning
2017-08-23 13:39 [PATCH] phy: ralink: fix 64-bit build warning Arnd Bergmann
2017-08-23 13:49 ` John Crispin
2017-08-23 13:58 ` Kishon Vijay Abraham I
@ 2017-08-23 13:59 ` Harvey Hunt
2017-08-23 14:20 ` Kishon Vijay Abraham I
3 siblings, 0 replies; 8+ messages in thread
From: Harvey Hunt @ 2017-08-23 13:59 UTC (permalink / raw)
To: Arnd Bergmann, Kishon Vijay Abraham I, John Crispin; +Cc: linux-kernel
Hi Arnd,
On 23/08/17 14: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@arndb.de>
> ---
> drivers/phy/ralink/phy-ralink-usb.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
[...]
Thanks for fixing this - it was on my TODO list.
Tested-by Harvey Hunt <harvey.hunt@imgtec.com>
Reviewed-by Harvey Hunt <harvey.hunt@imgtec.com>
Thanks,
Harvey
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] phy: ralink: fix 64-bit build warning
2017-08-23 13:39 [PATCH] phy: ralink: fix 64-bit build warning Arnd Bergmann
` (2 preceding siblings ...)
2017-08-23 13:59 ` Harvey Hunt
@ 2017-08-23 14:20 ` Kishon Vijay Abraham I
2017-08-23 23:30 ` Greg Kroah-Hartman
3 siblings, 1 reply; 8+ messages in thread
From: Kishon Vijay Abraham I @ 2017-08-23 14:20 UTC (permalink / raw)
To: Arnd Bergmann, John Crispin, Greg Kroah-Hartman; +Cc: Harvey Hunt, linux-kernel
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 <arnd@arndb.de>
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");
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] phy: ralink: fix 64-bit build warning
2017-08-23 14:20 ` Kishon Vijay Abraham I
@ 2017-08-23 23:30 ` Greg Kroah-Hartman
2017-08-24 7:49 ` Kishon Vijay Abraham I
0 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2017-08-23 23:30 UTC (permalink / raw)
To: Kishon Vijay Abraham I
Cc: Arnd Bergmann, John Crispin, Harvey Hunt, linux-kernel
On Wed, Aug 23, 2017 at 07:50:46PM +0530, Kishon Vijay Abraham I wrote:
> 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 <arnd@arndb.de>
>
> Can you pick this patch to fix the compiler warning.
Can you resend it to me in a format that I can apply it in?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] phy: ralink: fix 64-bit build warning
2017-08-23 23:30 ` Greg Kroah-Hartman
@ 2017-08-24 7:49 ` Kishon Vijay Abraham I
0 siblings, 0 replies; 8+ messages in thread
From: Kishon Vijay Abraham I @ 2017-08-24 7:49 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Arnd Bergmann, John Crispin, Harvey Hunt, linux-kernel
Greg,
On Thursday 24 August 2017 05:00 AM, Greg Kroah-Hartman wrote:
> On Wed, Aug 23, 2017 at 07:50:46PM +0530, Kishon Vijay Abraham I wrote:
>> 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 <arnd@arndb.de>
>>
>> Can you pick this patch to fix the compiler warning.
>
> Can you resend it to me in a format that I can apply it in?
sent them now.
Thanks
Kishon
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] phy: ralink: fix 64-bit build warning
@ 2017-08-24 7:49 Kishon Vijay Abraham I
0 siblings, 0 replies; 8+ messages in thread
From: Kishon Vijay Abraham I @ 2017-08-24 7:49 UTC (permalink / raw)
To: gregkh; +Cc: kishon, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
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")
Acked-by: John Crispin <john@phrozen.org>
Tested-by Harvey Hunt <harvey.hunt@imgtec.com>
Reviewed-by Harvey Hunt <harvey.hunt@imgtec.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
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");
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-08-24 7:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23 13:39 [PATCH] phy: ralink: fix 64-bit build warning Arnd Bergmann
2017-08-23 13:49 ` John Crispin
2017-08-23 13:58 ` Kishon Vijay Abraham I
2017-08-23 13:59 ` Harvey Hunt
2017-08-23 14:20 ` Kishon Vijay Abraham I
2017-08-23 23:30 ` Greg Kroah-Hartman
2017-08-24 7:49 ` Kishon Vijay Abraham I
2017-08-24 7:49 Kishon Vijay Abraham I
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.