Skip to content

Commit

Permalink
fs/proc/uptime.c: use ktime_get_boottime_ts64
Browse files Browse the repository at this point in the history
get_monotonic_boottime() is deprecated and uses the old timespec type.
Let's convert /proc/uptime to use ktime_get_boottime_ts64().

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnd Bergmann <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Deepa Dinamani <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
arndb authored and torvalds committed Aug 22, 2018
1 parent 2d6e4e8 commit bdf228a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/proc/uptime.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

static int uptime_proc_show(struct seq_file *m, void *v)
{
struct timespec uptime;
struct timespec64 uptime;
struct timespec64 idle;
u64 nsec;
u32 rem;
Expand All @@ -19,7 +19,7 @@ static int uptime_proc_show(struct seq_file *m, void *v)
for_each_possible_cpu(i)
nsec += (__force u64) kcpustat_cpu(i).cpustat[CPUTIME_IDLE];

get_monotonic_boottime(&uptime);
ktime_get_boottime_ts64(&uptime);
idle.tv_sec = div_u64_rem(nsec, NSEC_PER_SEC, &rem);
idle.tv_nsec = rem;
seq_printf(m, "%lu.%02lu %lu.%02lu\n",
Expand Down

0 comments on commit bdf228a

Please sign in to comment.