Re: [edk2] [patch] OvmfPkg: Fix VS toolchain build failure

2016-09-21 Thread Bi, Dandan
Ok!  Thank you for your comments! I will send patch with V2 for review. 

Thanks,
Dandan

-Original Message-
From: Laszlo Ersek [mailto:ler...@redhat.com] 
Sent: Thursday, September 22, 2016 9:07 AM
To: Bi, Dandan 
Cc: edk2-de...@ml01.01.org; Justen, Jordan L ; Gao, 
Liming 
Subject: Re: [patch] OvmfPkg: Fix VS toolchain build failure

On 09/22/16 02:54, Dandan Bi wrote:
> Cc: Jordan Justen 
> Cc: Laszlo Ersek 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi 
> ---
>  OvmfPkg/VirtioGpuDxe/Commands.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/OvmfPkg/VirtioGpuDxe/Commands.c 
> b/OvmfPkg/VirtioGpuDxe/Commands.c index b369dc3..53a94ac 100644
> --- a/OvmfPkg/VirtioGpuDxe/Commands.c
> +++ b/OvmfPkg/VirtioGpuDxe/Commands.c
> @@ -287,11 +287,11 @@ VirtioGpuSendCommand (
>  
>//
>// Compose the descriptor chain.
>//
>VirtioPrepare (&VgpuDev->Ring, &Indices);
> -  VirtioAppendDesc (&VgpuDev->Ring, (UINTN)Header, RequestSize,
> +  VirtioAppendDesc (&VgpuDev->Ring, (UINTN)Header, 
> + (UINT32)RequestSize,
>  VRING_DESC_F_NEXT, &Indices);
>VirtioAppendDesc (&VgpuDev->Ring, (UINTN)&Response, sizeof Response,
>  VRING_DESC_F_WRITE, &Indices);
>  
>//
> 

The patch is good, but I'd like to see another change: in the function, you see

  ASSERT (RequestSize >= sizeof *Header);

a little bit higher up.

Right under that, please add:

  ASSERT (RequestSize <= MAX_UINT32);

And then the cast is fine.

Can you please send v2 with this addition?

Thank you for addressing this compiler warning (and sorry about the 
inconvenience with the VS build).

Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] OvmfPkg: Fix VS toolchain build failure

2016-09-21 Thread Laszlo Ersek
On 09/22/16 02:54, Dandan Bi wrote:
> Cc: Jordan Justen 
> Cc: Laszlo Ersek 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi 
> ---
>  OvmfPkg/VirtioGpuDxe/Commands.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/OvmfPkg/VirtioGpuDxe/Commands.c b/OvmfPkg/VirtioGpuDxe/Commands.c
> index b369dc3..53a94ac 100644
> --- a/OvmfPkg/VirtioGpuDxe/Commands.c
> +++ b/OvmfPkg/VirtioGpuDxe/Commands.c
> @@ -287,11 +287,11 @@ VirtioGpuSendCommand (
>  
>//
>// Compose the descriptor chain.
>//
>VirtioPrepare (&VgpuDev->Ring, &Indices);
> -  VirtioAppendDesc (&VgpuDev->Ring, (UINTN)Header, RequestSize,
> +  VirtioAppendDesc (&VgpuDev->Ring, (UINTN)Header, (UINT32)RequestSize,
>  VRING_DESC_F_NEXT, &Indices);
>VirtioAppendDesc (&VgpuDev->Ring, (UINTN)&Response, sizeof Response,
>  VRING_DESC_F_WRITE, &Indices);
>  
>//
> 

The patch is good, but I'd like to see another change: in the function,
you see

  ASSERT (RequestSize >= sizeof *Header);

a little bit higher up.

Right under that, please add:

  ASSERT (RequestSize <= MAX_UINT32);

And then the cast is fine.

Can you please send v2 with this addition?

Thank you for addressing this compiler warning (and sorry about the
inconvenience with the VS build).

Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [patch] OvmfPkg: Fix VS toolchain build failure

2016-09-21 Thread Dandan Bi
Cc: Jordan Justen 
Cc: Laszlo Ersek 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi 
---
 OvmfPkg/VirtioGpuDxe/Commands.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OvmfPkg/VirtioGpuDxe/Commands.c b/OvmfPkg/VirtioGpuDxe/Commands.c
index b369dc3..53a94ac 100644
--- a/OvmfPkg/VirtioGpuDxe/Commands.c
+++ b/OvmfPkg/VirtioGpuDxe/Commands.c
@@ -287,11 +287,11 @@ VirtioGpuSendCommand (
 
   //
   // Compose the descriptor chain.
   //
   VirtioPrepare (&VgpuDev->Ring, &Indices);
-  VirtioAppendDesc (&VgpuDev->Ring, (UINTN)Header, RequestSize,
+  VirtioAppendDesc (&VgpuDev->Ring, (UINTN)Header, (UINT32)RequestSize,
 VRING_DESC_F_NEXT, &Indices);
   VirtioAppendDesc (&VgpuDev->Ring, (UINTN)&Response, sizeof Response,
 VRING_DESC_F_WRITE, &Indices);
 
   //
-- 
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel