Skip to content

Commit 81c8920

Browse files
krzklag-linaro
authored andcommitted
mfd: max14577: Fix Wvoid-pointer-to-enum-cast warning (again)
'type' is an enum, thus cast of pointer on 64-bit compile test with clang and W=1 causes: max14577.c:400:23: error: cast to smaller integer type 'enum maxim_device_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Year ago this was solved, although LKML discussion suggested warning is not suitable for kernel. Nothing changed in this regard for a year, so assume the warning will stay and we want to have warnings-free builds. Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 5fed47a commit 81c8920

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mfd/max14577.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ static int max14577_i2c_probe(struct i2c_client *i2c)
397397
return ret;
398398
}
399399

400-
max14577->dev_type = (enum maxim_device_type)i2c_get_match_data(i2c);
400+
max14577->dev_type = (kernel_ulong_t)i2c_get_match_data(i2c);
401401

402402
max14577_print_dev_type(max14577);
403403

0 commit comments

Comments
 (0)