From: venu byravarasu Date: Thu, 3 Nov 2011 09:12:14 +0000 (+0100) Subject: PM / Runtime: Fix runtime accounting calculation error X-Git-Tag: next-20111104~16^2~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ba8cd3b04272bcc0db2c9a3523305a90ee0faa07;p=karo-tx-linux.git 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 Signed-off-by: Rafael J. Wysocki --- 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)