diff options
author | Laszlo Ersek <lersek@redhat.com> | 2020-12-21 12:36:57 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-12-21 15:55:16 +0000 |
commit | c06635ea3f4b7b52054fe5d5b5e0cda3b594d2f5 (patch) | |
tree | 6ee8cf877a521fc63a6f1a9f31aa2df1b2b6757b /EmbeddedPkg/Include | |
parent | 3af6c521d9c1b195a6105169df92c0b3a8107e39 (diff) | |
download | edk2-c06635ea3f4b7b52054fe5d5b5e0cda3b594d2f5.tar.gz edk2-c06635ea3f4b7b52054fe5d5b5e0cda3b594d2f5.tar.bz2 edk2-c06635ea3f4b7b52054fe5d5b5e0cda3b594d2f5.zip |
EmbeddedPkg/TimeBaseLib: remove useless truncation to 32-bit
EfiTimeToEpoch() calls EfiGetEpochDays() internally, which (reasonably)
returns a UINTN. But then EfiTimeToEpoch() truncates the EfiGetEpochDays()
retval to UINT32 for no good reason, effectively restricting Time->Year
under 2106.
This truncation was pointed out with a valid warning (= build error) by
VS2019.
Allow EfiTimeToEpoch() to return / propagate a UINTN value.
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20201221113657.6779-3-lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Diffstat (limited to 'EmbeddedPkg/Include')
-rw-r--r-- | EmbeddedPkg/Include/Library/TimeBaseLib.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/EmbeddedPkg/Include/Library/TimeBaseLib.h b/EmbeddedPkg/Include/Library/TimeBaseLib.h index 3c2d3660c6..90853c3f4b 100644 --- a/EmbeddedPkg/Include/Library/TimeBaseLib.h +++ b/EmbeddedPkg/Include/Library/TimeBaseLib.h @@ -83,7 +83,7 @@ EpochToEfiTime ( /**
Converts EFI_TIME to Epoch seconds (elapsed since 1970 JANUARY 01, 00:00:00 UTC)
**/
-UINT32
+UINTN
EFIAPI
EfiTimeToEpoch (
IN EFI_TIME *Time
|