Skip to content

Commit 75674eb

Browse files
PeikanTsairafaeljw
authored andcommitted
PM: sleep: Use ktime_us_delta() in initcall_debug_report()
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 <[email protected]> [ rjw: Changelog rewrite, subject edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 3563f55 commit 75674eb

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/base/power/main.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,16 +220,13 @@ static void initcall_debug_report(struct device *dev, ktime_t calltime,
220220
void *cb, int error)
221221
{
222222
ktime_t rettime;
223-
s64 nsecs;
224223

225224
if (!pm_print_times_enabled)
226225
return;
227226

228227
rettime = ktime_get();
229-
nsecs = (s64) ktime_to_ns(ktime_sub(rettime, calltime));
230-
231228
dev_info(dev, "%pS returned %d after %Ld usecs\n", cb, error,
232-
(unsigned long long)nsecs >> 10);
229+
(unsigned long long)ktime_us_delta(rettime, calltime));
233230
}
234231

235232
/**

0 commit comments

Comments
 (0)