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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 10 Aug 2010 10:28:04 +0100
From:	Alan Cox <alan@...ux.intel.com>
To:	cbou@...l.ru, dwmw2@...radead.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] intel mid battery: Fix battery scaling

There are 3600 seconds per not 3600 hours per second. Correcting this
along with the previous fix gives sensible numbers.

Signed-off-by: Alan Cox <alan@...ux.intel.com>
---

 drivers/power/intel_mid_battery.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/drivers/power/intel_mid_battery.c b/drivers/power/intel_mid_battery.c
index 6430a7b..c61ffec 100644
--- a/drivers/power/intel_mid_battery.c
+++ b/drivers/power/intel_mid_battery.c
@@ -427,7 +427,7 @@ static int pmic_usb_get_property(struct power_supply *psy,
 static inline unsigned long mAStouAh(unsigned long v)
 {
 	/* seconds to hours, mA to µA */
-	return v * 3600 * 1000;
+	return (v * 1000) / 3600;
 }
 
 /**

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ