linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ia64: efi: use timespec64 for persistent clock
@ 2016-06-17 14:48 Arnd Bergmann
  2016-06-17 21:39 ` Luck, Tony
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2016-06-17 14:48 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu
  Cc: linux-efi, linux-ia64, Arnd Bergmann, Toshi Kani, Ard Biesheuvel,
	y2038, linux-kernel, Matt Fleming, Ingo Molnar

We have a generic read_persistent_clock64 interface now, and can
change the ia64 implementation to provide that instead of
read_persistent_clock.

The main point of this is to avoid the use of struct timespec
in the global efi.h, which would cause build errors as soon
as we want to build a kernel without 'struct timespec' defined
on 32-bit architectures.

Aside from this, we get a little closer to removing the
__weak read_persistent_clock() definition, which relies on
converting all architectures to provide read_persistent_clock64
instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/ia64/kernel/efi.c  | 4 ++--
 arch/ia64/kernel/time.c | 2 +-
 include/linux/efi.h     | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index 3b7a60e40e8a..121295637d0d 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -236,7 +236,7 @@ STUB_GET_NEXT_HIGH_MONO_COUNT(virt, id)
 STUB_RESET_SYSTEM(virt, id)
 
 void
-efi_gettimeofday (struct timespec *ts)
+efi_gettimeofday (struct timespec64 *ts)
 {
 	efi_time_t tm;
 
@@ -245,7 +245,7 @@ efi_gettimeofday (struct timespec *ts)
 		return;
 	}
 
-	ts->tv_sec = mktime(tm.year, tm.month, tm.day,
+	ts->tv_sec = mktime64(tm.year, tm.month, tm.day,
 			    tm.hour, tm.minute, tm.second);
 	ts->tv_nsec = tm.nanosecond;
 }
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index c8dbe2acd735..6f892b94e906 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -355,7 +355,7 @@ static struct irqaction timer_irqaction = {
 	.name =		"timer"
 };
 
-void read_persistent_clock(struct timespec *ts)
+void read_persistent_clock64(struct timespec64 *ts)
 {
 	efi_gettimeofday(ts);
 }
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 9a53a557acff..dca8810d6b49 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -937,7 +937,7 @@ extern void efi_init (void);
 extern void *efi_get_pal_addr (void);
 extern void efi_map_pal_code (void);
 extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg);
-extern void efi_gettimeofday (struct timespec *ts);
+extern void efi_gettimeofday (struct timespec64 *ts);
 extern void efi_enter_virtual_mode (void);	/* switch EFI to virtual mode, if possible */
 #ifdef CONFIG_X86
 extern void efi_late_init(void);
-- 
2.9.0

_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] ia64: efi: use timespec64 for persistent clock
  2016-06-17 14:48 [PATCH] ia64: efi: use timespec64 for persistent clock Arnd Bergmann
@ 2016-06-17 21:39 ` Luck, Tony
  0 siblings, 0 replies; 2+ messages in thread
From: Luck, Tony @ 2016-06-17 21:39 UTC (permalink / raw)
  To: Arnd Bergmann, Yu, Fenghua
  Cc: y2038, Matt Fleming, Ingo Molnar, Toshi Kani, Ard Biesheuvel,
	linux-efi, linux-ia64, linux-kernel

> Aside from this, we get a little closer to removing the
> __weak read_persistent_clock() definition, which relies on
> converting all architectures to provide read_persistent_clock64
> instead.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied. Thanks

-Tony

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-17 21:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-17 14:48 [PATCH] ia64: efi: use timespec64 for persistent clock Arnd Bergmann
2016-06-17 21:39 ` Luck, Tony

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).