Skip to content

Commit

Permalink
PM / Runtime: Fix runtime accounting calculation error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
venu byravarasu authored and Rafael J. Wysocki committed Nov 4, 2011
1 parent e9db50b commit def0c0a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/base/power/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit def0c0a

Please sign in to comment.