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]
Message-Id: <1273595926-26249-3-git-send-email-daniel@caiaq.de>
Date:	Tue, 11 May 2010 18:38:46 +0200
From:	Daniel Mack <daniel@...aq.de>
To:	linux-kernel@...r.kernel.org
Cc:	Daniel Mack <daniel@...aq.de>,
	Anton Vorontsov <avorontsov@...mvista.com>,
	Matt Reimer <mreimer@...p.net>,
	Evgeniy Polyakov <zbr@...emap.net>, Tejun Heo <tj@...nel.org>,
	David Woodhouse <dwmw2@...radead.org>,
	Len Brown <len.brown@...el.com>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Subject: [PATCH 3/3] power/ds2760_battery: use factor of 20 for rated_capacity

In the ds2760 driver, the currently used factor of 10 to store the rated
battery capacity internally is not sufficient for batteries > 2.55 Ah,
as the 8-bit register will overflow for bigger values.

Change the factor to 20 to broaden that range. Note that due to
RATED_CAPACITY_FACTOR, the external interface won't change, neither for
the writeable sysfs entires nor for the kernel rated_capacity module
parameter.

Signed-off-by: Daniel Mack <daniel@...aq.de>
Cc: Anton Vorontsov <avorontsov@...mvista.com>
Cc: Matt Reimer <mreimer@...p.net>
Cc: Evgeniy Polyakov <zbr@...emap.net>
Cc: Tejun Heo <tj@...nel.org>
Cc: David Woodhouse <dwmw2@...radead.org>
Cc: Len Brown <len.brown@...el.com>
Cc: Mark Brown <broonie@...nsource.wolfsonmicro.com>
---
 drivers/power/ds2760_battery.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/power/ds2760_battery.c b/drivers/power/ds2760_battery.c
index b82bf92..7b3043f 100644
--- a/drivers/power/ds2760_battery.c
+++ b/drivers/power/ds2760_battery.c
@@ -78,7 +78,7 @@ MODULE_PARM_DESC(current_accum, "current accumulator value");
 
 /* Some batteries have their rated capacity stored a N * 10 mAh, while
  * others use an index into this table. */
-#define RATED_CAPACITY_FACTOR 10
+#define RATED_CAPACITY_FACTOR 20
 static int rated_capacities[] = {
 	0,
 	920,	/* Samsung */
-- 
1.7.1

--
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