From 3af6c521d9c1b195a6105169df92c0b3a8107e39 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Mon, 21 Dec 2020 12:36:56 +0100 Subject: ArmPlatformPkg/PL031RealTimeClockLib: cast EfiTimeToEpoch() val. to UINT32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ArmPlatformPkg') 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 -- cgit v1.2.3