diff mbox series

sysinfo: remove get_monotonic_boottime()

Message ID 20180618150114.849216-1-arnd@arndb.de
State New
Headers show
Series sysinfo: remove get_monotonic_boottime() | expand

Commit Message

Arnd Bergmann June 18, 2018, 3 p.m. UTC
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.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 kernel/sys.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.9.0

Comments

Cyrill Gorcunov June 18, 2018, 3:18 p.m. UTC | #1
On Mon, Jun 18, 2018 at 05:00:38PM +0200, Arnd Bergmann wrote:
> 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.

> 

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> ---

>  kernel/sys.c | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/kernel/sys.c b/kernel/sys.c

> index ccaeffa2171b..24f838da8ca1 100644

> --- a/kernel/sys.c

> +++ b/kernel/sys.c

> @@ -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);


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

Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com>
diff mbox series

Patch

diff --git a/kernel/sys.c b/kernel/sys.c
index ccaeffa2171b..24f838da8ca1 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -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);