Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: ge: Fix build warning

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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Thierry Reding and committed by
Linus Walleij
668f0657 ba3efdff

+1 -1
+1 -1
drivers/gpio/gpio-ge.c
··· 80 80 } 81 81 82 82 gc->base = -1; 83 - gc->ngpio = (u16)of_device_get_match_data(&pdev->dev); 83 + gc->ngpio = (u16)(uintptr_t)of_device_get_match_data(&pdev->dev); 84 84 gc->of_gpio_n_cells = 2; 85 85 gc->of_node = pdev->dev.of_node; 86 86