public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] power: supply: axp20x_usb_power: fix 64-bit build warning
@ 2017-01-11 14:51 Arnd Bergmann
  2017-01-12  2:58 ` Sebastian Reichel
  0 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2017-01-11 14:51 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Arnd Bergmann, Chen-Yu Tsai, Quentin Schulz, linux-pm,
	linux-kernel

Casting a pointer to 'int' is not always valid:

drivers/power/supply/axp20x_usb_power.c: In function 'axp20x_usb_power_probe':
drivers/power/supply/axp20x_usb_power.c:297:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

This makes the code use uintptr_t explicitly.

Fixes: 0dcc70ca8644 ("power: supply: axp20x_usb_power: use of_device_id data field instead of device_is_compatible")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/power/supply/axp20x_usb_power.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c
index 1bcb02551e02..ecad8b6f9b84 100644
--- a/drivers/power/supply/axp20x_usb_power.c
+++ b/drivers/power/supply/axp20x_usb_power.c
@@ -294,7 +294,7 @@ static int axp20x_usb_power_probe(struct platform_device *pdev)
 	if (!power)
 		return -ENOMEM;
 
-	power->axp20x_id = (int)of_device_get_match_data(&pdev->dev);
+	power->axp20x_id = (uintptr_t)of_device_get_match_data(&pdev->dev);
 
 	power->np = pdev->dev.of_node;
 	power->regmap = axp20x->regmap;
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-12 17:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-11 14:51 [PATCH] power: supply: axp20x_usb_power: fix 64-bit build warning Arnd Bergmann
2017-01-12  2:58 ` Sebastian Reichel
2017-01-12  8:32   ` Arnd Bergmann
2017-01-12 15:53     ` Michal Suchánek
2017-01-12 16:11       ` Arnd Bergmann
2017-01-12 17:39     ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox