]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/LinuxInitrdDynamicShellCommand: Cast UNIT64 to UNITN in assignment
authorBob Feng <bob.c.feng@intel.com>
Tue, 10 Mar 2020 08:44:26 +0000 (16:44 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 12 Mar 2020 02:10:23 +0000 (02:10 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2580

Ovmf build failed on Windows with VS2017 tool chain.
The error message like:

OvmfPkg\LinuxInitrdDynamicShellCommand\LinuxInitr
 dDynamicShellCommand.c(199): error C2220: warning treated as error -
 no 'object' file generated
OvmfPkg\LinuxInitrdDynamicShellCommand\LinuxInitrdDynamicShellCommand.c(199):
warning C4244: '=': conversion from 'UINT64' to 'UINTN',
possible loss of data

This patch is to cast UINT64 type to UINTN type
when doing the variable assignment.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c

index 021b072826a95c997c9f8c8a7bdaee8a512f716c..07baa0e8d10001eb2ec6fd003d6f8f4389a622fe 100644 (file)
@@ -196,7 +196,7 @@ CacheInitrdFile (
     ASSERT_EFI_ERROR (Status);\r
   }\r
 \r
-  mInitrdFileSize = FileSize;\r
+  mInitrdFileSize = (UINTN)FileSize;\r
   return EFI_SUCCESS;\r
 \r
 FreeMemory:\r