[PATCH] mux: adgs1408: fix Wvoid-pointer-to-enum-cast warning

Krzysztof Kozlowski posted 1 patch 2 years, 6 months ago
There is a newer version of this series
drivers/mux/adgs1408.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] mux: adgs1408: fix Wvoid-pointer-to-enum-cast warning
Posted by Krzysztof Kozlowski 2 years, 6 months ago
'chip_id' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

  adgs1408.c:62:12: error: cast to smaller integer type 'enum adgs1408_chip_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/mux/adgs1408.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mux/adgs1408.c b/drivers/mux/adgs1408.c
index 22ed051eb1a4..29836062152c 100644
--- a/drivers/mux/adgs1408.c
+++ b/drivers/mux/adgs1408.c
@@ -59,7 +59,7 @@ static int adgs1408_probe(struct spi_device *spi)
 	s32 idle_state;
 	int ret;
 
-	chip_id = (enum adgs1408_chip_id)device_get_match_data(dev);
+	chip_id = (uintptr_t)device_get_match_data(dev);
 	if (!chip_id)
 		chip_id = spi_get_device_id(spi)->driver_data;
 
-- 
2.34.1