]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gpio: ge: Fix build warning
authorThierry Reding <treding@nvidia.com>
Thu, 3 May 2018 12:46:24 +0000 (14:46 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 16 May 2018 12:35:24 +0000 (14:35 +0200)
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>
drivers/gpio/gpio-ge.c

index 4c43562434cf1bb90cfbfabadf1559b6a90e2657..636952769bc82bd251c31d51ea38821deed49b7a 100644 (file)
@@ -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;