Skip to content

Commit 58aec51

Browse files
krzkgroeck
authored andcommitted
hwmon: (tmp513) fix Wvoid-pointer-to-enum-cast warning
'id' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: tmp513.c:724:14: error: cast to smaller integer type 'enum tmp51x_ids' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-11-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent d6f0947 commit 58aec51

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/hwmon/tmp513.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ static int tmp51x_probe(struct i2c_client *client)
721721
return -ENOMEM;
722722

723723
if (client->dev.of_node)
724-
data->id = (enum tmp51x_ids)device_get_match_data(&client->dev);
724+
data->id = (uintptr_t)device_get_match_data(&client->dev);
725725
else
726726
data->id = i2c_match_id(tmp51x_id, client)->driver_data;
727727

0 commit comments

Comments
 (0)