Skip to content

Commit

Permalink
PM: sleep: Use ktime_us_delta() in initcall_debug_report()
Browse files Browse the repository at this point in the history
Use ktime_us_delta() to make the debug log more precise instead of
shifting the return value of ktime_to_ns() applied to a ktime_sub()
result by 10 bit positions to the right.

Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
[ rjw: Changelog rewrite, subject edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Mark-PK Tsai authored and Rafael J. Wysocki committed Jul 1, 2021
1 parent 3563f55 commit 75674eb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/base/power/main.c
Original file line number Diff line number Diff line change
@@ -220,16 +220,13 @@ static void initcall_debug_report(struct device *dev, ktime_t calltime,
void *cb, int error)
{
ktime_t rettime;
s64 nsecs;

if (!pm_print_times_enabled)
return;

rettime = ktime_get();
nsecs = (s64) ktime_to_ns(ktime_sub(rettime, calltime));

dev_info(dev, "%pS returned %d after %Ld usecs\n", cb, error,
(unsigned long long)nsecs >> 10);
(unsigned long long)ktime_us_delta(rettime, calltime));
}

/**

0 comments on commit 75674eb

Please sign in to comment.