From def0c0a37d02820497fcd5a74b6cc93dbce5dc06 Mon Sep 17 00:00:00 2001 From: venu byravarasu Date: Thu, 3 Nov 2011 10:12:14 +0100 Subject: 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 --- drivers/base/power/runtime.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/base') 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) -- cgit v1.2.3