* [PATCH] power: supply: max17040: Fix ptr to enum cast
@ 2020-10-05 20:00 Iskren Chernev
2020-10-08 23:07 ` Sebastian Reichel
0 siblings, 1 reply; 2+ messages in thread
From: Iskren Chernev @ 2020-10-05 20:00 UTC (permalink / raw)
To: Sebastian Reichel
Cc: linux-pm, linux-kernel, ~postmarketos/upstreaming,
Iskren Chernev, kernel test robot
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>
---
P.S. I fixed a similar issue in v5, but it was in another patch, and the
test robot only complains about the first issue, so I missed this one.
There is a similar warning in ltc2941-battery-gauge, let me know if I
should submit a fix for it as well.
drivers/power/supply/max17040_battery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/max17040_battery.c b/drivers/power/supply/max17040_battery.c
index 1d7510a59295d..d956c67d51558 100644
--- a/drivers/power/supply/max17040_battery.c
+++ b/drivers/power/supply/max17040_battery.c
@@ -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];
base-commit: f9d293364b452b651292ed3034dd06c57b1754d5
--
2.28.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] power: supply: max17040: Fix ptr to enum cast
2020-10-05 20:00 [PATCH] power: supply: max17040: Fix ptr to enum cast Iskren Chernev
@ 2020-10-08 23:07 ` Sebastian Reichel
0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2020-10-08 23:07 UTC (permalink / raw)
To: Iskren Chernev
Cc: linux-pm, linux-kernel, ~postmarketos/upstreaming, kernel test robot
[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]
Hi,
On Mon, Oct 05, 2020 at 11:00:38PM +0300, Iskren Chernev wrote:
> 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>
> ---
Thanks, queued.
> P.S. I fixed a similar issue in v5, but it was in another patch, and the
> test robot only complains about the first issue, so I missed this one.
>
> There is a similar warning in ltc2941-battery-gauge, let me know if I
> should submit a fix for it as well.
Sure.
-- Sebastian
> drivers/power/supply/max17040_battery.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/max17040_battery.c b/drivers/power/supply/max17040_battery.c
> index 1d7510a59295d..d956c67d51558 100644
> --- a/drivers/power/supply/max17040_battery.c
> +++ b/drivers/power/supply/max17040_battery.c
> @@ -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];
>
>
> base-commit: f9d293364b452b651292ed3034dd06c57b1754d5
> --
> 2.28.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-08 23:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-05 20:00 [PATCH] power: supply: max17040: Fix ptr to enum cast Iskren Chernev
2020-10-08 23:07 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).