mfd: sun4i-gpadc: Fix 'cast from pointer to integer of different size' warning
authorLee Jones <lee.jones@linaro.org>
Wed, 26 Oct 2016 16:07:35 +0000 (17:07 +0100)
committerLee Jones <lee.jones@linaro.org>
Tue, 29 Nov 2016 08:21:26 +0000 (08:21 +0000)
When building for X86 using COMPILE_TEST we get this warning:

../drivers/mfd/sun4i-gpadc.c: In function ‘sun4i_gpadc_probe’:
../drivers/mfd/sun4i-gpadc.c:110:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

Since an integer and a pointer are difference sizes on 64bit architectures.

Convert to case to a long instead.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/sun4i-gpadc.c

index 8a7ee5b6beb12caabddd31a0264637a84c4c9035..9cfc88134d031bb9639be9caee62cf451838371a 100644 (file)
@@ -107,7 +107,7 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
        if (!of_id)
                return -EINVAL;
 
-       switch ((int)of_id->data) {
+       switch ((long)of_id->data) {
        case ARCH_SUN4I_A10:
                cells = sun4i_gpadc_cells;
                size = ARRAY_SIZE(sun4i_gpadc_cells);