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]
Date:   Mon, 14 Nov 2022 06:10:38 -0800
From:   Elijah Conners <business@...jahpepe.com>
To:     "linux-kernel" <linux-kernel@...r.kernel.org>,
        "linux-pm" <linux-pm@...r.kernel.org>
Cc:     "mszyprowski" <m.szyprowski@...sung.com>
Subject: [PATCH] drivers: undo simplify POWER_SUPPLY_PROP_ONLINE

Per the work done by arturo182, the value of max17040() with LiPo
batteries will always be 1, even if it's not connected. This is
ambiguous and setting the return value to 1 presents complications for
anyone working with LiPo batteries, and does not result in significant
overhead.

Signed-off-by: Elijah Conners <business@...jahpepe.com>
---
 drivers/power/supply/max17040_battery.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/power/supply/max17040_battery.c b/drivers/power/supply/max17040_battery.c
index a9aef1e8b186..5284f2bf735c 100644
--- a/drivers/power/supply/max17040_battery.c
+++ b/drivers/power/supply/max17040_battery.c
@@ -217,7 +217,8 @@ static int max17040_get_version(struct max17040_chip *chip)
 
 static int max17040_get_online(struct max17040_chip *chip)
 {
-	return 1;
+	return chip->pdata && chip->pdata->battery_online ?
+		chip->pdata->battery_online() : 1;
 }
 
 static int max17040_get_of_data(struct max17040_chip *chip)
-- 
2.29.2.windows.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ