]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/PL031RealTimeClockLib: cast EfiTimeToEpoch() val. to UINT32
authorLaszlo Ersek <lersek@redhat.com>
Mon, 21 Dec 2020 11:36:56 +0000 (12:36 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 21 Dec 2020 15:55:16 +0000 (15:55 +0000)
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 <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-2-lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c

index 0df4ceb1cb39fec80553a61d8a50df415862f502..3afef4bf9ad4829acbbdc8336d09beb49a1681f0 100644 (file)
@@ -200,7 +200,7 @@ LibSetTime (
     }\r
   }\r
 \r
-  EpochSeconds = EfiTimeToEpoch (Time);\r
+  EpochSeconds = (UINT32)EfiTimeToEpoch (Time);\r
 \r
   // Adjust for the correct time zone, i.e. convert to UTC time zone\r
   // The timezone setting also reflects the DST setting of the clock\r