aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvenu byravarasu <vbyravarasu@nvidia.com>2011-11-03 05:12:14 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-11-04 17:28:10 -0400
commitdef0c0a37d02820497fcd5a74b6cc93dbce5dc06 (patch)
tree4bfa6ef68b49887f3948abffbbd49d3175b16727
parente9db50b839c592fcd22952d7f1dccbd0a56da57d (diff)
PM / Runtime: Fix runtime accounting calculation error
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@nvidia.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r--drivers/base/power/runtime.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 6bb3aafa85ed..18ef87e525fa 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -29,13 +29,10 @@ static int rpm_suspend(struct device *dev, int rpmflags);
29void update_pm_runtime_accounting(struct device *dev) 29void update_pm_runtime_accounting(struct device *dev)
30{ 30{
31 unsigned long now = jiffies; 31 unsigned long now = jiffies;
32 int delta; 32 unsigned long delta;
33 33
34 delta = now - dev->power.accounting_timestamp; 34 delta = now - dev->power.accounting_timestamp;
35 35
36 if (delta < 0)
37 delta = 0;
38
39 dev->power.accounting_timestamp = now; 36 dev->power.accounting_timestamp = now;
40 37
41 if (dev->power.disable_depth > 0) 38 if (dev->power.disable_depth > 0)