From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.1561.1583829878777942651 for ; Tue, 10 Mar 2020 01:44:39 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: bob.c.feng@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Mar 2020 01:44:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,535,1574150400"; d="scan'208";a="441222773" Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.66]) by fmsmga005.fm.intel.com with ESMTP; 10 Mar 2020 01:44:35 -0700 From: "Bob Feng" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Laszlo Ersek Subject: [Patch 1/1] OvmfPkg/LinuxInitrdDynamicShellCommand: Cast UNIT64 to UNITN in assignment Date: Tue, 10 Mar 2020 16:44:26 +0800 Message-Id: <20200310084426.29044-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Ard Biesheuvel Cc: Laszlo Ersek --- .../LinuxInitrdDynamicShellCommand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c b/OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c index 021b072826a9..07baa0e8d100 100644 --- a/OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c +++ b/OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c @@ -194,11 +194,11 @@ CacheInitrdFile ( &gEfiLoadFile2ProtocolGuid, &mInitrdLoadFile2, NULL); ASSERT_EFI_ERROR (Status); } - mInitrdFileSize = FileSize; + mInitrdFileSize = (UINTN)FileSize; return EFI_SUCCESS; FreeMemory: gBS->FreePages (mInitrdFileAddress, EFI_SIZE_TO_PAGES ((UINTN)FileSize)); return Status; -- 2.20.1.windows.1