From: Laszlo Ersek Date: Mon, 21 Dec 2020 11:36:56 +0000 (+0100) Subject: ArmPlatformPkg/PL031RealTimeClockLib: cast EfiTimeToEpoch() val. to UINT32 X-Git-Tag: edk2-stable202102~317 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=3af6c521d9c1b195a6105169df92c0b3a8107e39;p=mirror_edk2.git ArmPlatformPkg/PL031RealTimeClockLib: cast EfiTimeToEpoch() val. to UINT32 In preparation for changing EfiTimeToEpoch()'s return type to UINTN, cast EfiTimeToEpoch()'s retval to UINT32 explicitly, in LibSetTime(). Currently, this is a no-op, and even after widening the retval, it will make no difference, as LibSetTime() explicitly restricts Time->Year under 2106, given that "the PL031 is a 32-bit counter counting seconds". The patch is made for preventing compiler warnings. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Philippe Mathieu-Daudé Signed-off-by: Laszlo Ersek Message-Id: <20201221113657.6779-2-lersek@redhat.com> Acked-by: Ard Biesheuvel --- diff --git a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c index 0df4ceb1cb..3afef4bf9a 100644 --- a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c +++ b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c @@ -200,7 +200,7 @@ LibSetTime ( } } - EpochSeconds = EfiTimeToEpoch (Time); + EpochSeconds = (UINT32)EfiTimeToEpoch (Time); // Adjust for the correct time zone, i.e. convert to UTC time zone // The timezone setting also reflects the DST setting of the clock