x86: fix unused efi_get_time function
PATCH 1/1 x86: fix unused efi_get_time function
Nothing calls the efi_get_time function on x86, but it does suffer from the 32-bit time_t overflow in 2038.
To avoid that if anyone starts calling it, this changes the function to use timespec64 and mktime64 instead.
---
The obvious alternative would be to remove the function, I'll send that patch as well, so you can pick one or the other.
arch/x86/platform/efi/efi.c | 6 +++--- include/linux/efi.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/platform/efi/efi.c +3 -3
@@ -97,7 +97,7 @@ static efi_status_t __init phys_efi_set_virtual_address_map(return status; } -void efi_get_time (struct timespec *now) +void efi_get_time (struct timespec64 *now) {efi_status_t status;efi_time_t eft;
@@ -107,8 +107,8 @@ void efi_get_time(struct timespec *now)if (status !=EFI_SUCCESS )pr_err ("Oops: efitime: can't read time!\n" ); - now->tv_sec =mktime (eft.year, eft.month, eft.day, eft.hour, - eft.minute, eft.second); + now->tv_sec =mktime64 (eft.year, eft.month, eft.day, eft.hour, + eft.minute, eft.second); now->tv_nsec =0 ; }
include/linux/efi.h +1 -1
@@ -975,7 +975,7 @@ extern u64 efi_mem_desc_end(efi_memory_desc_t *md);extern int efi_mem_desc_lookup (u64 phys_addr,efi_memory_desc_t *out_md);extern void efi_initialize_iomem_resources (struct resource *code_resource,struct resource *data_resource,struct resource *bss_resource); -extern void efi_get_time (struct timespec *now); +extern void efi_get_time (struct timespec64 *now);extern void efi_reserve_boot_services (void );extern int efi_get_fdt_params (struct efi_fdt_params *params);extern struct kobject *efi_kobj;
Signature · 1 line
2.9.0
Quoted 6 lines · Arnd Bergmann
Nothing calls the
efi_get_timefunction on x86, but it does suffer from the 32-bittime_toverflow in 2038.To avoid that if anyone starts calling it, this changes the function to use timespec64 and mktime64 instead.
Quoted 8 lines
Signed-off-by Arnd Bergmann <[email protected]>---
The obvious alternative would be to remove the function, I'll send that patch as well, so you can pick one or the other.arch/x86/platform/efi/efi.c | 6 +++--- include/linux/efi.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
Looks good, thanks Arnd!
_______________________________________________
Y2038 mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/y2038