Skip to content

Commit 7b28133

Browse files
krzklag-linaro
authored andcommitted
mfd: wm8994: 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: wm8994-core.c:625:17: error: cast to smaller integer type 'enum wm8994_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]> Reviewed-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 105d4b4 commit 7b28133

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mfd/wm8994-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ static int wm8994_i2c_probe(struct i2c_client *i2c)
622622
wm8994->dev = &i2c->dev;
623623
wm8994->irq = i2c->irq;
624624

625-
wm8994->type = (enum wm8994_type)i2c_get_match_data(i2c);
625+
wm8994->type = (kernel_ulong_t)i2c_get_match_data(i2c);
626626

627627
wm8994->regmap = devm_regmap_init_i2c(i2c, &wm8994_base_regmap_config);
628628
if (IS_ERR(wm8994->regmap)) {

0 commit comments

Comments
 (0)