[PATCH 1/2] Input: mms114 - fix Wvoid-pointer-to-enum-cast warning

From: Krzysztof Kozlowski
Date: Thu Aug 10 2023 - 06:00:54 EST


'type' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

drivers/input/touchscreen/mms114.c:507:15: error: cast to smaller integer type 'enum mms_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
---
drivers/input/touchscreen/mms114.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c
index af233b6a16d9..d9beb15a3676 100644
--- a/drivers/input/touchscreen/mms114.c
+++ b/drivers/input/touchscreen/mms114.c
@@ -504,7 +504,7 @@ static int mms114_probe(struct i2c_client *client)
if (!match_data)
return -EINVAL;

- data->type = (enum mms_type)match_data;
+ data->type = (uintptr_t)match_data;

data->num_keycodes = device_property_count_u32(&client->dev,
"linux,keycodes");
--
2.34.1