From: Iskren Chernev <iskren.chernev@gmail.com>
To: Sebastian Reichel <sre@kernel.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
~postmarketos/upstreaming@lists.sr.ht,
Iskren Chernev <iskren.chernev@gmail.com>,
kernel test robot <lkp@intel.com>
Subject: [PATCH] power: supply: max17040: Fix ptr to enum cast
Date: Mon, 5 Oct 2020 23:00:38 +0300 [thread overview]
Message-ID: <20201005200038.1032697-1-iskren.chernev@gmail.com> (raw)
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
next reply other threads:[~2020-10-05 20:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-05 20:00 Iskren Chernev [this message]
2020-10-08 23:07 ` [PATCH] power: supply: max17040: Fix ptr to enum cast Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201005200038.1032697-1-iskren.chernev@gmail.com \
--to=iskren.chernev@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lkp@intel.com \
--cc=sre@kernel.org \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).