* [PATCH] power: supply: ltc2941: Fix ptr to enum cast
@ 2020-10-10 6:55 Iskren Chernev
2020-10-10 23:30 ` Sebastian Reichel
0 siblings, 1 reply; 2+ messages in thread
From: Iskren Chernev @ 2020-10-10 6:55 UTC (permalink / raw)
To: Sebastian Reichel
Cc: linux-pm, linux-kernel, ~postmarketos/upstreaming, Iskren Chernev
clang complains about casting pointers to smaller enum types.
Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>
---
drivers/power/supply/ltc2941-battery-gauge.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/power/supply/ltc2941-battery-gauge.c b/drivers/power/supply/ltc2941-battery-gauge.c
index 30a9014b2f95e..10cd617516ec2 100644
--- a/drivers/power/supply/ltc2941-battery-gauge.c
+++ b/drivers/power/supply/ltc2941-battery-gauge.c
@@ -473,7 +473,8 @@ static int ltc294x_i2c_probe(struct i2c_client *client,
np = of_node_get(client->dev.of_node);
- info->id = (enum ltc294x_id)of_device_get_match_data(&client->dev);
+ info->id = (enum ltc294x_id) (uintptr_t) of_device_get_match_data(
+ &client->dev);
info->supply_desc.name = np->name;
/* r_sense can be negative, when sense+ is connected to the battery
base-commit: 411643e949f4e616f758e2c6079f333b0e704c49
--
2.28.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] power: supply: ltc2941: Fix ptr to enum cast
2020-10-10 6:55 [PATCH] power: supply: ltc2941: Fix ptr to enum cast Iskren Chernev
@ 2020-10-10 23:30 ` Sebastian Reichel
0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2020-10-10 23:30 UTC (permalink / raw)
To: Iskren Chernev; +Cc: linux-pm, linux-kernel, ~postmarketos/upstreaming
[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]
Hi,
On Sat, Oct 10, 2020 at 09:55:26AM +0300, Iskren Chernev wrote:
> clang complains about casting pointers to smaller enum types.
>
> Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>
> ---
Thanks, queued.
-- Sebastian
> drivers/power/supply/ltc2941-battery-gauge.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/ltc2941-battery-gauge.c b/drivers/power/supply/ltc2941-battery-gauge.c
> index 30a9014b2f95e..10cd617516ec2 100644
> --- a/drivers/power/supply/ltc2941-battery-gauge.c
> +++ b/drivers/power/supply/ltc2941-battery-gauge.c
> @@ -473,7 +473,8 @@ static int ltc294x_i2c_probe(struct i2c_client *client,
>
> np = of_node_get(client->dev.of_node);
>
> - info->id = (enum ltc294x_id)of_device_get_match_data(&client->dev);
> + info->id = (enum ltc294x_id) (uintptr_t) of_device_get_match_data(
> + &client->dev);
> info->supply_desc.name = np->name;
>
> /* r_sense can be negative, when sense+ is connected to the battery
>
> base-commit: 411643e949f4e616f758e2c6079f333b0e704c49
> --
> 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-10 23:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-10 6:55 [PATCH] power: supply: ltc2941: Fix ptr to enum cast Iskren Chernev
2020-10-10 23:30 ` Sebastian Reichel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.