Thread (2 messages) 2 messages, 2 authors, 2023-08-18

[PATCH] crypto: exynos - fix Wvoid-pointer-to-enum-cast warning

From: Krzysztof Kozlowski <hidden>
Date: 2023-08-10 10:02:56
Also in: linux-arm-kernel, linux-samsung-soc, lkml
Subsystem: crypto api, samsung exynos pseudo random number generator (rng) driver, the rest · Maintainers: Herbert Xu, "David S. Miller", Krzysztof Kozlowski, Linus Torvalds

'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 <redacted>
---
 drivers/crypto/exynos-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/exynos-rng.c b/drivers/crypto/exynos-rng.c
index cbd8ca6e52ee..b1df66be9adc 100644
--- a/drivers/crypto/exynos-rng.c
+++ b/drivers/crypto/exynos-rng.c
@@ -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);
 
-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help