[PATCH v2] PM: fix runtime accounting calculation error

From: vbyravarasu
Date: Fri Oct 28 2011 - 04:41:01 EST


From: venu byravarasu <vbyravarasu@xxxxxxxxxx>

With delta type being int, its value is made zero
for all values of now > 0x80000000.
Hence fixing it.

Signed-off-by: venu byravarasu <vbyravarasu@xxxxxxxxxx>
---
changes since v1:
Removed max_num and its usage references.
..........

drivers/base/power/runtime.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 1079e03..e8a5172 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -30,13 +30,10 @@ static int rpm_suspend(struct device *dev, int rpmflags);
void update_pm_runtime_accounting(struct device *dev)
{
unsigned long now = jiffies;
- int delta;
+ unsigned long delta;

delta = now - dev->power.accounting_timestamp;

- if (delta < 0)
- delta = 0;
-
dev->power.accounting_timestamp = now;

if (dev->power.disable_depth > 0)
--
1.7.1.1

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