Re: [edk2-devel] [PATCH 13/35] MdeModulePkg: PEI Core: clean up "AprioriFile" handling in FindFileEx()

2019-09-24 Thread Philippe Mathieu-Daudé
On 9/17/19 9:49 PM, Laszlo Ersek wrote:
> Clean up two issues around FindFileEx():
> 
> - The "AprioriFile" parameter's type differs between the function
>   declaration and the function definition. The correct type is
>   (EFI_PEI_FILE_HANDLE*).
> 
> - "FfsFileHeader" has type (EFI_FFS_FILE_HEADER*); for clarity, we should
>   cast it explicitly to EFI_PEI_FILE_HANDLE when assigning it to
>   (*AprioriFile).
> 
> This is a semantic cleanup, there is no functional change.
> 
> Cc: Dandan Bi 
> Cc: Hao A Wu 
> Cc: Jian J Wang 
> Cc: Liming Gao 
> Signed-off-by: Laszlo Ersek 
> ---
> 
> Notes:
> lightly tested: OVMF uses APRIORI PEI in the FDF files
> 
>  MdeModulePkg/Core/Pei/FwVol/FwVol.h | 2 +-
>  MdeModulePkg/Core/Pei/FwVol/FwVol.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.h 
> b/MdeModulePkg/Core/Pei/FwVol/FwVol.h
> index 4082cfbec1f8..ca80e84e0fcb 100644
> --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.h
> +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.h
> @@ -299,7 +299,7 @@ FindFileEx (
>IN  CONST EFI_GUID *FileName,   OPTIONAL
>INEFI_FV_FILETYPE  SearchType,
>IN OUTEFI_PEI_FILE_HANDLE  *FileHandle,
> -  IN OUTEFI_PEI_FV_HANDLE*AprioriFile  OPTIONAL
> +  IN OUTEFI_PEI_FILE_HANDLE  *AprioriFile  OPTIONAL
>);
>  
>  /**
> diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c 
> b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> index 709db00694c2..f4642c47c13a 100644
> --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> @@ -407,7 +407,7 @@ FindFileEx (
>  } else if (AprioriFile != NULL) {
>if (FfsFileHeader->Type == EFI_FV_FILETYPE_FREEFORM) {
>  if (CompareGuid (>Name, 
> )) {
> -  *AprioriFile = FfsFileHeader;
> +  *AprioriFile = (EFI_PEI_FILE_HANDLE)FfsFileHeader;
>  }
>}
>  }
> 

Reviewed-by: Philippe Mathieu-Daude 

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

View/Reply Online (#47964): https://edk2.groups.io/g/devel/message/47964
Mute This Topic: https://groups.io/mt/34180214/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 13/35] MdeModulePkg: PEI Core: clean up "AprioriFile" handling in FindFileEx()

2019-09-18 Thread Dandan Bi
Reviewed-by: Dandan Bi 

Thanks,
Dandan

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Wednesday, September 18, 2019 3:49 AM
> To: edk2-devel-groups-io 
> Cc: Bi, Dandan ; Wu, Hao A ;
> Wang, Jian J ; Gao, Liming 
> Subject: [PATCH 13/35] MdeModulePkg: PEI Core: clean up "AprioriFile"
> handling in FindFileEx()
> 
> Clean up two issues around FindFileEx():
> 
> - The "AprioriFile" parameter's type differs between the function
>   declaration and the function definition. The correct type is
>   (EFI_PEI_FILE_HANDLE*).
> 
> - "FfsFileHeader" has type (EFI_FFS_FILE_HEADER*); for clarity, we should
>   cast it explicitly to EFI_PEI_FILE_HANDLE when assigning it to
>   (*AprioriFile).
> 
> This is a semantic cleanup, there is no functional change.
> 
> Cc: Dandan Bi 
> Cc: Hao A Wu 
> Cc: Jian J Wang 
> Cc: Liming Gao 
> Signed-off-by: Laszlo Ersek 
> ---
> 
> Notes:
> lightly tested: OVMF uses APRIORI PEI in the FDF files
> 
>  MdeModulePkg/Core/Pei/FwVol/FwVol.h | 2 +-
> MdeModulePkg/Core/Pei/FwVol/FwVol.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.h
> b/MdeModulePkg/Core/Pei/FwVol/FwVol.h
> index 4082cfbec1f8..ca80e84e0fcb 100644
> --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.h
> +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.h
> @@ -299,7 +299,7 @@ FindFileEx (
>IN  CONST EFI_GUID *FileName,   OPTIONAL
>INEFI_FV_FILETYPE  SearchType,
>IN OUTEFI_PEI_FILE_HANDLE  *FileHandle,
> -  IN OUTEFI_PEI_FV_HANDLE*AprioriFile  OPTIONAL
> +  IN OUTEFI_PEI_FILE_HANDLE  *AprioriFile  OPTIONAL
>);
> 
>  /**
> diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> index 709db00694c2..f4642c47c13a 100644
> --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> @@ -407,7 +407,7 @@ FindFileEx (
>  } else if (AprioriFile != NULL) {
>if (FfsFileHeader->Type == EFI_FV_FILETYPE_FREEFORM) {
>  if (CompareGuid (>Name, ))
> {
> -  *AprioriFile = FfsFileHeader;
> +  *AprioriFile = (EFI_PEI_FILE_HANDLE)FfsFileHeader;
>  }
>}
>  }
> --
> 2.19.1.3.g30247aa5d201
> 


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

View/Reply Online (#47516): https://edk2.groups.io/g/devel/message/47516
Mute This Topic: https://groups.io/mt/34180214/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 13/35] MdeModulePkg: PEI Core: clean up "AprioriFile" handling in FindFileEx()

2019-09-17 Thread Laszlo Ersek
Clean up two issues around FindFileEx():

- The "AprioriFile" parameter's type differs between the function
  declaration and the function definition. The correct type is
  (EFI_PEI_FILE_HANDLE*).

- "FfsFileHeader" has type (EFI_FFS_FILE_HEADER*); for clarity, we should
  cast it explicitly to EFI_PEI_FILE_HANDLE when assigning it to
  (*AprioriFile).

This is a semantic cleanup, there is no functional change.

Cc: Dandan Bi 
Cc: Hao A Wu 
Cc: Jian J Wang 
Cc: Liming Gao 
Signed-off-by: Laszlo Ersek 
---

Notes:
lightly tested: OVMF uses APRIORI PEI in the FDF files

 MdeModulePkg/Core/Pei/FwVol/FwVol.h | 2 +-
 MdeModulePkg/Core/Pei/FwVol/FwVol.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.h 
b/MdeModulePkg/Core/Pei/FwVol/FwVol.h
index 4082cfbec1f8..ca80e84e0fcb 100644
--- a/MdeModulePkg/Core/Pei/FwVol/FwVol.h
+++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.h
@@ -299,7 +299,7 @@ FindFileEx (
   IN  CONST EFI_GUID *FileName,   OPTIONAL
   INEFI_FV_FILETYPE  SearchType,
   IN OUTEFI_PEI_FILE_HANDLE  *FileHandle,
-  IN OUTEFI_PEI_FV_HANDLE*AprioriFile  OPTIONAL
+  IN OUTEFI_PEI_FILE_HANDLE  *AprioriFile  OPTIONAL
   );
 
 /**
diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c 
b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
index 709db00694c2..f4642c47c13a 100644
--- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c
+++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
@@ -407,7 +407,7 @@ FindFileEx (
 } else if (AprioriFile != NULL) {
   if (FfsFileHeader->Type == EFI_FV_FILETYPE_FREEFORM) {
 if (CompareGuid (>Name, )) {
-  *AprioriFile = FfsFileHeader;
+  *AprioriFile = (EFI_PEI_FILE_HANDLE)FfsFileHeader;
 }
   }
 }
-- 
2.19.1.3.g30247aa5d201



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

View/Reply Online (#47400): https://edk2.groups.io/g/devel/message/47400
Mute This Topic: https://groups.io/mt/34180214/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-