Skip to contentSkip to conversation

procfs: uptime: use ktime_get_boottime_ts64

PATCH In review Arnd Bergmann 2 participants 2 messages Jun 20, 2018 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 procfs: uptime: use ktime_get_boottime_ts64

get_monotonic_boottime() is deprecated and uses the old timespec type. Let's convert /proc/uptime to use ktime_get_boottime_ts64().

---
 fs/proc/uptime.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/proc/uptime.c +2 -2
index 3f723cb478af..a4c2791ab70b 100644
@@ -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;
@@ -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",
Signature · 1 line
2.9.0