From: Kishon Vijay Abraham I <kishon@ti.com>
To: <gregkh@linuxfoundation.org>
Cc: <kishon@ti.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] phy: ralink: fix 64-bit build warning
Date: Thu, 24 Aug 2017 13:19:08 +0530 [thread overview]
Message-ID: <20170824074908.10719-1-kishon@ti.com> (raw)
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
next reply other threads:[~2017-08-24 7:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-24 7:49 Kishon Vijay Abraham I [this message]
-- strict thread matches above, loose matches on Subject: below --
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170824074908.10719-1-kishon@ti.com \
--to=kishon@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox