summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTirupathi Reddy <tirupath@codeaurora.org>2017-02-10 18:06:40 +0530
committerTirupathi Reddy <tirupath@codeaurora.org>2017-02-10 18:18:41 +0530
commit6e2aa6379c8e68c215172d977e441e9cd720ea5c (patch)
tree8c2cc4dacd31160f91fbe04acbc75ecc2788b8e5
parentdd6494d94ef819c093157f73a314e9927305d305 (diff)
qpnp-fg-gen3: fix 32-bit compilation
Make division operations in qpnp-fg-gen3 32-bit compatible. CRs-Fixed: 2005232 Change-Id: I33215147d093aef3f04c46912bddd5aef284d7c4 Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
-rw-r--r--drivers/power/supply/qcom/qpnp-fg-gen3.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/power/supply/qcom/qpnp-fg-gen3.c b/drivers/power/supply/qcom/qpnp-fg-gen3.c
index 12f3d448c891..ed62c63c134d 100644
--- a/drivers/power/supply/qcom/qpnp-fg-gen3.c
+++ b/drivers/power/supply/qcom/qpnp-fg-gen3.c
@@ -2283,7 +2283,8 @@ static void sram_dump_work(struct work_struct *work)
sram_dump_work.work);
u8 buf[FG_SRAM_LEN];
int rc;
- s64 timestamp_ms;
+ s64 timestamp_ms, quotient;
+ s32 remainder;
rc = fg_sram_read(chip, 0, 0, buf, FG_SRAM_LEN, FG_IMA_DEFAULT);
if (rc < 0) {
@@ -2292,12 +2293,14 @@ static void sram_dump_work(struct work_struct *work)
}
timestamp_ms = ktime_to_ms(ktime_get_boottime());
- fg_dbg(chip, FG_STATUS, "SRAM Dump Started at %lld.%lld\n",
- timestamp_ms / 1000, timestamp_ms % 1000);
+ quotient = div_s64_rem(timestamp_ms, 1000, &remainder);
+ fg_dbg(chip, FG_STATUS, "SRAM Dump Started at %lld.%d\n",
+ quotient, remainder);
dump_sram(buf, 0, FG_SRAM_LEN);
timestamp_ms = ktime_to_ms(ktime_get_boottime());
- fg_dbg(chip, FG_STATUS, "SRAM Dump done at %lld.%lld\n",
- timestamp_ms / 1000, timestamp_ms % 1000);
+ quotient = div_s64_rem(timestamp_ms, 1000, &remainder);
+ fg_dbg(chip, FG_STATUS, "SRAM Dump done at %lld.%d\n",
+ quotient, remainder);
resched:
schedule_delayed_work(&chip->sram_dump_work,
msecs_to_jiffies(fg_sram_dump_period_ms));