Skip to content

Commit 737055e

Browse files
krzkalexandrebelloni
authored andcommitted
rtc: ds1307: fix Wvoid-pointer-to-enum-cast warning
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: rtc-ds1307.c:1747:18: error: cast to smaller integer type 'enum ds_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent d57d12d commit 737055e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/rtc/rtc-ds1307.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1744,7 +1744,7 @@ static int ds1307_probe(struct i2c_client *client)
17441744

17451745
match = device_get_match_data(&client->dev);
17461746
if (match) {
1747-
ds1307->type = (enum ds_type)match;
1747+
ds1307->type = (uintptr_t)match;
17481748
chip = &chips[ds1307->type];
17491749
} else if (id) {
17501750
chip = &chips[id->driver_data];

0 commit comments

Comments
 (0)