spi: pxa2xx: fix Wvoid-pointer-to-enum-cast warning
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 10 Aug 2023 09:12:46 +0000 (11:12 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 14 Aug 2023 12:11:14 +0000 (13:11 +0100)
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  spi-pxa2xx.c:1347:10: error: cast to smaller integer type 'enum pxa_ssp_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810091247.70149-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-pxa2xx.c

index 1bab18a..21f1565 100644 (file)
@@ -1344,7 +1344,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
 
        match = device_get_match_data(dev);
        if (match)
-               type = (enum pxa_ssp_type)match;
+               type = (uintptr_t)match;
        else if (is_lpss_priv) {
                u32 value;