diff options
author | venu byravarasu <vbyravarasu@nvidia.com> | 2011-11-03 10:12:14 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-11-04 22:28:10 +0100 |
commit | def0c0a37d02820497fcd5a74b6cc93dbce5dc06 (patch) | |
tree | 4bfa6ef68b49887f3948abffbbd49d3175b16727 /drivers/base | |
parent | e9db50b839c592fcd22952d7f1dccbd0a56da57d (diff) | |
download | linux-stable-def0c0a37d02820497fcd5a74b6cc93dbce5dc06.tar.gz linux-stable-def0c0a37d02820497fcd5a74b6cc93dbce5dc06.tar.bz2 linux-stable-def0c0a37d02820497fcd5a74b6cc93dbce5dc06.zip |
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>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | 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 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); 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) |