crypto: exynos - fix Wvoid-pointer-to-enum-cast warning
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 10 Aug 2023 10:00:23 +0000 (12:00 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 18 Aug 2023 09:01:09 +0000 (17:01 +0800)
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  exynos-rng.c:280:14: error: cast to smaller integer type 'enum exynos_prng_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/exynos-rng.c

index cbd8ca6..b1df66b 100644 (file)
@@ -277,7 +277,7 @@ static int exynos_rng_probe(struct platform_device *pdev)
        if (!rng)
                return -ENOMEM;
 
-       rng->type = (enum exynos_prng_type)of_device_get_match_data(&pdev->dev);
+       rng->type = (uintptr_t)of_device_get_match_data(&pdev->dev);
 
        mutex_init(&rng->lock);