Skip to content

Commit 126ac4d

Browse files
andy-shevpmladek
authored andcommitted
kdb: Switch to use %ptTs
Use %ptTs instead of open-coded variant to print contents of time64_t type in human readable form. Cc: Jason Wessel <[email protected]> Cc: Daniel Thompson <[email protected]> Cc: [email protected] Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Acked-by: Daniel Thompson <[email protected]> Signed-off-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 20bc8c1 commit 126ac4d

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

kernel/debug/kdb/kdb_main.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,7 +2488,6 @@ static void kdb_sysinfo(struct sysinfo *val)
24882488
static int kdb_summary(int argc, const char **argv)
24892489
{
24902490
time64_t now;
2491-
struct tm tm;
24922491
struct sysinfo val;
24932492

24942493
if (argc)
@@ -2502,13 +2501,7 @@ static int kdb_summary(int argc, const char **argv)
25022501
kdb_printf("domainname %s\n", init_uts_ns.name.domainname);
25032502

25042503
now = __ktime_get_real_seconds();
2505-
time64_to_tm(now, 0, &tm);
2506-
kdb_printf("date %04ld-%02d-%02d %02d:%02d:%02d "
2507-
"tz_minuteswest %d\n",
2508-
1900+tm.tm_year, tm.tm_mon+1, tm.tm_mday,
2509-
tm.tm_hour, tm.tm_min, tm.tm_sec,
2510-
sys_tz.tz_minuteswest);
2511-
2504+
kdb_printf("date %ptTs tz_minuteswest %d\n", &now, sys_tz.tz_minuteswest);
25122505
kdb_sysinfo(&val);
25132506
kdb_printf("uptime ");
25142507
if (val.uptime > (24*60*60)) {

0 commit comments

Comments
 (0)