Skip to contentSkip to conversation

gpio: ge: Fix build warning

PATCH New Thierry Reding 1 participant 1 message May 3, 2018 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: ge: Fix build warning

From: Thierry Reding <[email protected]>

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.

---
 drivers/gpio/gpio-ge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-ge.c +1 -1
index 4c43562434cf..636952769bc8 100644
@@ -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;
 
Signature · 1 line
2.17.0