Skip to contentSkip to conversation

sysinfo: remove get_monotonic_boottime()

PATCH In review Arnd Bergmann 3 participants 3 messages Jun 18, 2018 – Jun 19, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sysinfo: remove get_monotonic_boottime()

get_monotonic_boottime() is deprecated because it uses the old 'timespec' structure. This replaces one of the last callers with a call to ktime_get_boottime.

---
 kernel/sys.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sys.c +2 -2
index ccaeffa2171b..24f838da8ca1 100644
@@ -2574,11 +2574,11 @@ static int do_sysinfo(struct sysinfo *info)
 {
 	unsigned long mem_total, sav_total;
 	unsigned int mem_unit, bitcount;
-	struct timespec tp;
+	struct timespec64 tp;
 
 	memset(info, 0, sizeof(struct sysinfo));
 
-	get_monotonic_boottime(&tp);
+	ktime_get_boottime_ts64(&tp);
 	info->uptime = tp.tv_sec + (tp.tv_nsec ? 1 : 0);
 
 	get_avenrun(info->loads, 0, SI_LOAD_SHIFT - FSHIFT);
Signature · 1 line
2.9.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Arnd Bergmann

get_monotonic_boottime() is deprecated because it uses the old 'timespec' structure. This replaces one of the last callers with a call to ktime_get_boottime.

---
 kernel/sys.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sys.c +0 -0
index ccaeffa2171b..24f838da8ca1 100644
@@ -2574,11 +2574,11 @@ static int do_sysinfo(struct sysinfo *info)
 {
 	unsigned long mem_total, sav_total;
 	unsigned int mem_unit, bitcount;

kernel/sys.c static int do_sysinfo(struct sysinfo *info) · line 2584

Quoted 10 lines
kernel/sys.c +2 -2
-	struct timespec tp;
+	struct timespec64 tp;
 
 	memset(info, 0, sizeof(struct sysinfo));
 
-	get_monotonic_boottime(&tp);
+	ktime_get_boottime_ts64(&tp);
 	info->uptime = tp.tv_sec + (tp.tv_nsec ? 1 : 0);
 
 	get_avenrun(info->loads, 0, SI_LOAD_SHIFT - FSHIFT);

The change is pretty obvious. Looks ok to me (though I missed the moment when timespec became old ;)

#2 lore raw

[tip:timers/core] sysinfo: Remove get_monotonic_boottime()

In reply to Arnd Bergmann
sysinfo: Remove get_monotonic_boottime()
Commit-ID:  dc1b7b6ca9d5fa905c164a667086d8a3d8605875
Gitweb:     https://git.kernel.org/tip/dc1b7b6ca9d5fa905c164a667086d8a3d8605875
Author:     Arnd Bergmann <[email protected]>
AuthorDate: Mon, 18 Jun 2018 17:00:38 +0200
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Tue, 19 Jun 2018 09:56:27 +0200

sysinfo: Remove get_monotonic_boottime()

get_monotonic_boottime() is deprecated because it uses the old 'timespec' structure. This replaces one of the last callers with a call to ktime_get_boottime.

---
 kernel/sys.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sys.c +2 -2
index 38509dc1f77b..e27b51d3facd 100644
@@ -2512,11 +2512,11 @@ static int do_sysinfo(struct sysinfo *info)
 {
 	unsigned long mem_total, sav_total;
 	unsigned int mem_unit, bitcount;
-	struct timespec tp;
+	struct timespec64 tp;
 
 	memset(info, 0, sizeof(struct sysinfo));
 
-	get_monotonic_boottime(&tp);
+	ktime_get_boottime_ts64(&tp);
 	info->uptime = tp.tv_sec + (tp.tv_nsec ? 1 : 0);
 
 	get_avenrun(info->loads, 0, SI_LOAD_SHIFT - FSHIFT);