diff options
Diffstat (limited to 'kernel/power/hibernate.c')
-rw-r--r-- | kernel/power/hibernate.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index 1f35a3478f3c..2329daae5255 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/syscore_ops.h> | 28 | #include <linux/syscore_ops.h> |
29 | #include <linux/ctype.h> | 29 | #include <linux/ctype.h> |
30 | #include <linux/genhd.h> | 30 | #include <linux/genhd.h> |
31 | #include <linux/ktime.h> | ||
31 | #include <trace/events/power.h> | 32 | #include <trace/events/power.h> |
32 | 33 | ||
33 | #include "power.h" | 34 | #include "power.h" |
@@ -232,20 +233,17 @@ static void platform_recover(int platform_mode) | |||
232 | * @nr_pages: Number of memory pages processed between @start and @stop. | 233 | * @nr_pages: Number of memory pages processed between @start and @stop. |
233 | * @msg: Additional diagnostic message to print. | 234 | * @msg: Additional diagnostic message to print. |
234 | */ | 235 | */ |
235 | void swsusp_show_speed(struct timeval *start, struct timeval *stop, | 236 | void swsusp_show_speed(ktime_t start, ktime_t stop, |
236 | unsigned nr_pages, char *msg) | 237 | unsigned nr_pages, char *msg) |
237 | { | 238 | { |
239 | ktime_t diff; | ||
238 | u64 elapsed_centisecs64; | 240 | u64 elapsed_centisecs64; |
239 | unsigned int centisecs; | 241 | unsigned int centisecs; |
240 | unsigned int k; | 242 | unsigned int k; |
241 | unsigned int kps; | 243 | unsigned int kps; |
242 | 244 | ||
243 | elapsed_centisecs64 = timeval_to_ns(stop) - timeval_to_ns(start); | 245 | diff = ktime_sub(stop, start); |
244 | /* | 246 | elapsed_centisecs64 = ktime_divns(diff, 10*NSEC_PER_MSEC); |
245 | * If "(s64)elapsed_centisecs64 < 0", it will print long elapsed time, | ||
246 | * it is obvious enough for what went wrong. | ||
247 | */ | ||
248 | do_div(elapsed_centisecs64, NSEC_PER_SEC / 100); | ||
249 | centisecs = elapsed_centisecs64; | 247 | centisecs = elapsed_centisecs64; |
250 | if (centisecs == 0) | 248 | if (centisecs == 0) |
251 | centisecs = 1; /* avoid div-by-zero */ | 249 | centisecs = 1; /* avoid div-by-zero */ |