mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpio: ge: Fix build warning
@ 2018-05-03 12:46 Thierry Reding
  0 siblings, 0 replies; only message in thread
From: Thierry Reding @ 2018-05-03 12:46 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Casting a pointer to u16 can produce a compiler warning such as this:

    drivers/gpio/gpio-ge.c: In function 'gef_gpio_probe':
    drivers/gpio/gpio-ge.c:83:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
        gc->ngpio = (u16)of_device_get_match_data(&pdev->dev);
                    ^

Cast the pointer through a uintptr_t to avoid the warning.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpio-ge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-ge.c b/drivers/gpio/gpio-ge.c
index 4c43562434cf..636952769bc8 100644
--- a/drivers/gpio/gpio-ge.c
+++ b/drivers/gpio/gpio-ge.c
@@ -80,7 +80,7 @@ static int __init gef_gpio_probe(struct platform_device *pdev)
 	}
 
 	gc->base = -1;
-	gc->ngpio = (u16)of_device_get_match_data(&pdev->dev);
+	gc->ngpio = (u16)(uintptr_t)of_device_get_match_data(&pdev->dev);
 	gc->of_gpio_n_cells = 2;
 	gc->of_node = pdev->dev.of_node;
 
-- 
2.17.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-03 12:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-03 12:46 [PATCH] gpio: ge: Fix build warning Thierry Reding

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

Powered by JetHome