power: supply: max17040: Fix ptr to enum cast
authorIskren Chernev <iskren.chernev@gmail.com>
Mon, 5 Oct 2020 20:00:38 +0000 (23:00 +0300)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Thu, 8 Oct 2020 22:10:32 +0000 (00:10 +0200)
clang complains about casting pointers to smaller enum types.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/max17040_battery.c

index 1d7510a..d956c67 100644 (file)
@@ -247,7 +247,7 @@ static int max17040_get_of_data(struct max17040_chip *chip)
 {
        struct device *dev = &chip->client->dev;
        struct chip_data *data = &max17040_family[
-               (enum chip_id) of_device_get_match_data(dev)];
+               (uintptr_t) of_device_get_match_data(dev)];
        int rcomp_len;
        u8 rcomp[2];