From patchwork Fri Jun 17 14:51:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102159 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp321994qgy; Fri, 17 Jun 2016 07:52:11 -0700 (PDT) X-Received: by 10.36.228.72 with SMTP id o69mr4007203ith.9.1466175131204; Fri, 17 Jun 2016 07:52:11 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d67si11728479pfc.12.2016.06.17.07.52.10; Fri, 17 Jun 2016 07:52:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933603AbcFQOwI (ORCPT + 30 others); Fri, 17 Jun 2016 10:52:08 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:51423 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753305AbcFQOwF (ORCPT ); Fri, 17 Jun 2016 10:52:05 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0MQODc-1aoiDB1qNI-00ToAV; Fri, 17 Jun 2016 16:50:05 +0200 From: Arnd Bergmann To: Matt Fleming , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org Cc: y2038@lists.linaro.org, Arnd Bergmann , Ard Biesheuvel , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] x86: fix unused efi_get_time function Date: Fri, 17 Jun 2016 16:51:29 +0200 Message-Id: <20160617145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ux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Arnd Bergmann --- 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(-) -- 2.9.0 diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 56400d03409f..d72d5de02f61 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -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; } diff --git a/include/linux/efi.h b/include/linux/efi.h index acb6adace01e..dca8810d6b49 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -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;