Reviewed-by: Ray Ni <ray...@intel.com>

> -----Original Message-----
> From: Ard Biesheuvel <a...@kernel.org>
> Sent: Monday, May 29, 2023 6:17 PM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel <a...@kernel.org>; Ni, Ray <ray...@intel.com>; Yao, Jiewen
> <jiewen....@intel.com>; Gerd Hoffmann <kra...@redhat.com>; Taylor Beebe
> <t...@taylorbeebe.com>; Oliver Smith-Denny <o...@smith-denny.com>; Bi, Dandan
> <dandan...@intel.com>; Gao, Liming <gaolim...@byosoft.com.cn>; Kinney,
> Michael D <michael.d.kin...@intel.com>; Leif Lindholm
> <quic_llind...@quicinc.com>; Michael Kubacki <mikub...@linux.microsoft.com>
> Subject: [RFC PATCH 03/11] MdeModulePkg/DxeCore: Remove FreePage
> argument from CoreUnloadImage
> 
> The FreePage argument to CoreUnloadAndCloseImage () is now always TRUE
> so drop it from the prototype. While at it, make the function static as
> it is never called from another translation unit.
> 
> Signed-off-by: Ard Biesheuvel <a...@kernel.org>
> ---
>  MdeModulePkg/Core/Dxe/Image/Image.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c
> b/MdeModulePkg/Core/Dxe/Image/Image.c
> index 6625d0cd0ff82107..f30e369370a09609 100644
> --- a/MdeModulePkg/Core/Dxe/Image/Image.c
> +++ b/MdeModulePkg/Core/Dxe/Image/Image.c
> @@ -888,13 +888,12 @@ CoreLoadedImageInfo (
>    Unloads EFI image from memory.
> 
> 
> 
>    @param  Image                   EFI image
> 
> -  @param  FreePage                Free allocated pages
> 
> 
> 
>  **/
> 
> +STATIC
> 
>  VOID
> 
>  CoreUnloadAndCloseImage (
> 
> -  IN LOADED_IMAGE_PRIVATE_DATA  *Image,
> 
> -  IN BOOLEAN                    FreePage
> 
> +  IN LOADED_IMAGE_PRIVATE_DATA  *Image
> 
>    )
> 
>  {
> 
>    EFI_STATUS                           Status;
> 
> @@ -1022,7 +1021,7 @@ CoreUnloadAndCloseImage (
>    //
> 
>    // Free the Image from memory
> 
>    //
> 
> -  if ((Image->ImageBasePage != 0) && FreePage) {
> 
> +  if (Image->ImageBasePage != 0) {
> 
>      CoreFreePages (Image->ImageBasePage, Image->NumberOfPages);
> 
>    }
> 
> 
> 
> @@ -1413,7 +1412,7 @@ CoreLoadImageCommon (
>    //
> 
>    if (EFI_ERROR (Status)) {
> 
>      if (Image != NULL) {
> 
> -      CoreUnloadAndCloseImage (Image, TRUE);
> 
> +      CoreUnloadAndCloseImage (Image);
> 
>        Image = NULL;
> 
>      }
> 
>    } else if (EFI_ERROR (SecurityStatus)) {
> 
> @@ -1711,7 +1710,7 @@ CoreStartImage (
>    // unload it
> 
>    //
> 
>    if (EFI_ERROR (Image->Status) || (Image->Type ==
> EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION)) {
> 
> -    CoreUnloadAndCloseImage (Image, TRUE);
> 
> +    CoreUnloadAndCloseImage (Image);
> 
>      //
> 
>      // ImageHandle may be invalid after the image is unloaded, so use NULL
> handle to record perf log.
> 
>      //
> 
> @@ -1776,7 +1775,7 @@ CoreExit (
>      //
> 
>      // The image has not been started so just free its resources
> 
>      //
> 
> -    CoreUnloadAndCloseImage (Image, TRUE);
> 
> +    CoreUnloadAndCloseImage (Image);
> 
>      Status = EFI_SUCCESS;
> 
>      goto Done;
> 
>    }
> 
> @@ -1874,7 +1873,7 @@ CoreUnloadImage (
>      //
> 
>      // if the Image was not started or Unloaded O.K. then clean up
> 
>      //
> 
> -    CoreUnloadAndCloseImage (Image, TRUE);
> 
> +    CoreUnloadAndCloseImage (Image);
> 
>    }
> 
> 
> 
>  Done:
> 
> --
> 2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105407): https://edk2.groups.io/g/devel/message/105407
Mute This Topic: https://groups.io/mt/99197135/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to