[edk2-devel] [patch v2] OvmfPkg: Fix build failure with VS2015 tool chain

Liming Gao posted 1 patch 4 years, 8 months ago
Failed in applying to current master (apply log)
OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[edk2-devel] [patch v2] OvmfPkg: Fix build failure with VS2015 tool chain
Posted by Liming Gao 4 years, 8 months ago
warning C4244: '=': conversion from 'UINTN' to 'UINT32', possible loss of data
With this fix, OvmfIa32, OvmfX64 and OvmfIa32X64 can pass build.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c b/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c
index 1868c9fcaf..1f02da2503 100644
--- a/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c
+++ b/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c
@@ -384,7 +384,7 @@ QemuLoadKernelImage (
     //
     // Drop the terminating NUL, convert to UTF-16.
     //
-    KernelLoadedImage->LoadOptionsSize = (CommandLineSize - 1) * 2;
+    KernelLoadedImage->LoadOptionsSize = (UINT32) ((CommandLineSize - 1) * 2);
   }
 
   QemuFwCfgSelectItem (QemuFwCfgItemInitrdSize);
-- 
2.13.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55782): https://edk2.groups.io/g/devel/message/55782
Mute This Topic: https://groups.io/mt/71896179/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [patch v2] OvmfPkg: Fix build failure with VS2015 tool chain
Posted by Laszlo Ersek 4 years, 8 months ago
Hello Liming,

(adding Michael)

On 03/12/20 05:30, Liming Gao wrote:
> warning C4244: '=': conversion from 'UINTN' to 'UINT32', possible loss of data
> With this fix, OvmfIa32, OvmfX64 and OvmfIa32X64 can pass build.
> 
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Signed-off-by: Liming Gao <liming.gao@intel.com>
> ---
>  OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c b/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c
> index 1868c9fcaf..1f02da2503 100644
> --- a/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c
> +++ b/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c
> @@ -384,7 +384,7 @@ QemuLoadKernelImage (
>      //
>      // Drop the terminating NUL, convert to UTF-16.
>      //
> -    KernelLoadedImage->LoadOptionsSize = (CommandLineSize - 1) * 2;
> +    KernelLoadedImage->LoadOptionsSize = (UINT32) ((CommandLineSize - 1) * 2);
>    }
>  
>    QemuFwCfgSelectItem (QemuFwCfgItemInitrdSize);
> 

This patch seems to be fixing the pre-existent TianoCore ticket

https://bugzilla.tianocore.org/show_bug.cgi?id=2582

Can you please coordinate with Michael?

BTW, I prefer this patch to the one that Michael attached to the ticket
in <https://bugzilla.tianocore.org/show_bug.cgi?id=2582#c3>.

So my suggestion is for Liming to reassign the BZ to himself please,
reference the BZ in the commit message, and then merge this patch.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Thanks,
Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55796): https://edk2.groups.io/g/devel/message/55796
Mute This Topic: https://groups.io/mt/71896179/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [patch v2] OvmfPkg: Fix build failure with VS2015 tool chain
Posted by Liming Gao 4 years, 8 months ago
I take BZ 2582. I will update the commit message and merge this change. 

Thanks
Liming
> -----Original Message-----
> From: Laszlo Ersek <lersek@redhat.com>
> Sent: Thursday, March 12, 2020 3:47 PM
> To: Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>; michael.kubacki@microsoft.com
> Subject: Re: [patch v2] OvmfPkg: Fix build failure with VS2015 tool chain
> 
> Hello Liming,
> 
> (adding Michael)
> 
> On 03/12/20 05:30, Liming Gao wrote:
> > warning C4244: '=': conversion from 'UINTN' to 'UINT32', possible loss of data
> > With this fix, OvmfIa32, OvmfX64 and OvmfIa32X64 can pass build.
> >
> > Cc: Laszlo Ersek <lersek@redhat.com>
> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > Signed-off-by: Liming Gao <liming.gao@intel.com>
> > ---
> >  OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c
> b/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c
> > index 1868c9fcaf..1f02da2503 100644
> > --- a/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c
> > +++ b/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c
> > @@ -384,7 +384,7 @@ QemuLoadKernelImage (
> >      //
> >      // Drop the terminating NUL, convert to UTF-16.
> >      //
> > -    KernelLoadedImage->LoadOptionsSize = (CommandLineSize - 1) * 2;
> > +    KernelLoadedImage->LoadOptionsSize = (UINT32) ((CommandLineSize - 1) * 2);
> >    }
> >
> >    QemuFwCfgSelectItem (QemuFwCfgItemInitrdSize);
> >
> 
> This patch seems to be fixing the pre-existent TianoCore ticket
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=2582
> 
> Can you please coordinate with Michael?
> 
> BTW, I prefer this patch to the one that Michael attached to the ticket
> in <https://bugzilla.tianocore.org/show_bug.cgi?id=2582#c3>.
> 
> So my suggestion is for Liming to reassign the BZ to himself please,
> reference the BZ in the commit message, and then merge this patch.
> 
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> 
> Thanks,
> Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55888): https://edk2.groups.io/g/devel/message/55888
Mute This Topic: https://groups.io/mt/71896179/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-