lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201005200038.1032697-1-iskren.chernev@gmail.com>
Date:   Mon,  5 Oct 2020 23:00:38 +0300
From:   Iskren Chernev <iskren.chernev@...il.com>
To:     Sebastian Reichel <sre@...nel.org>
Cc:     linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        ~postmarketos/upstreaming@...ts.sr.ht,
        Iskren Chernev <iskren.chernev@...il.com>,
        kernel test robot <lkp@...el.com>
Subject: [PATCH] power: supply: max17040: Fix ptr to enum cast

clang complains about casting pointers to smaller enum types.

Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: Iskren Chernev <iskren.chernev@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ