mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@linux.intel.com>
To: cbou@mail.ru, dwmw2@infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] intel mid battery: Fix battery scaling
Date: Tue, 10 Aug 2010 10:28:04 +0100	[thread overview]
Message-ID: <20100810092804.1814.66442.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100810092700.1814.11982.stgit@localhost.localdomain>

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@linux.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;
 }
 
 /**


  parent reply	other threads:[~2010-08-10 10:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10  9:27 [PATCH 0/2] Battery fixes Alan Cox
2010-08-10  9:27 ` [PATCH 1/2] Fix the argument order to intel_scu_ipc_command in the battery driver Alan Cox
2010-08-10  9:28 ` Alan Cox [this message]
2010-08-10 10:37 ` [PATCH 0/2] Battery fixes Anton Vorontsov

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=20100810092804.1814.66442.stgit@localhost.localdomain \
    --to=alan@linux.intel.com \
    --cc=cbou@mail.ru \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome