mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linaro.org>
To: jason.wessel@windriver.com, daniel.thompson@linaro.org
Cc: baolin.wang@linaro.org, mingo@kernel.org, arnd@arndb.de,
	broonie@kernel.org, kgdb-bugreport@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: [PATCH] kdb: Change timespec to use timespec64
Date: Thu, 25 Jan 2018 16:05:54 +0800	[thread overview]
Message-ID: <acb789d2e1df1c30d6dfcb9452fef1a398c3b113.1516867148.git.baolin.wang@linaro.org> (raw)

Since struct timespec is not y2038 safe on 32 bit machines, thus replace
uses of struct timespec with struct timespec64 in the kernel.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 kernel/debug/kdb/kdb_main.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index c8146d5..c20c61e 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -2488,7 +2488,7 @@ struct kdb_tm {
 	int tm_year;	/* year */
 };
 
-static void kdb_gmtime(struct timespec *tv, struct kdb_tm *tm)
+static void kdb_gmtime(struct timespec64 *tv, struct kdb_tm *tm)
 {
 	/* This will work from 1970-2099, 2100 is not a leap year */
 	static int mon_day[] = { 31, 29, 31, 30, 31, 30, 31,
@@ -2521,8 +2521,8 @@ static void kdb_gmtime(struct timespec *tv, struct kdb_tm *tm)
  */
 static void kdb_sysinfo(struct sysinfo *val)
 {
-	struct timespec uptime;
-	ktime_get_ts(&uptime);
+	struct timespec64 uptime;
+	ktime_get_ts64(&uptime);
 	memset(val, 0, sizeof(*val));
 	val->uptime = uptime.tv_sec;
 	val->loads[0] = avenrun[0];
@@ -2539,7 +2539,7 @@ static void kdb_sysinfo(struct sysinfo *val)
  */
 static int kdb_summary(int argc, const char **argv)
 {
-	struct timespec now;
+	struct timespec64 now;
 	struct kdb_tm tm;
 	struct sysinfo val;
 
@@ -2554,7 +2554,7 @@ static int kdb_summary(int argc, const char **argv)
 	kdb_printf("domainname %s\n", init_uts_ns.name.domainname);
 	kdb_printf("ccversion  %s\n", __stringify(CCVERSION));
 
-	now = __current_kernel_time();
+	now = current_kernel_time64();
 	kdb_gmtime(&now, &tm);
 	kdb_printf("date       %04d-%02d-%02d %02d:%02d:%02d "
 		   "tz_minuteswest %d\n",
-- 
1.7.9.5

             reply	other threads:[~2018-01-25  8:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25  8:05 Baolin Wang [this message]
2018-01-25  8:55 ` Arnd Bergmann
2018-01-25  9:18   ` Baolin Wang
2018-01-25 11:38     ` Daniel Thompson
2018-01-25 14:49       ` Jason Wessel
2018-01-25 15:12         ` Arnd Bergmann
2018-01-26  1:40           ` Baolin Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=acb789d2e1df1c30d6dfcb9452fef1a398c3b113.1516867148.git.baolin.wang@linaro.org \
    --to=baolin.wang@linaro.org \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=daniel.thompson@linaro.org \
    --cc=jason.wessel@windriver.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®