CoreLoadImageCommon's only user passes NULL for its EntryPoint argument,
so it has no purpose and can simply be dropped. While at it, make
CoreLoadImageCommon STATIC to prevent it from being accessed from other
translation units.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>
---
 MdeModulePkg/Core/Dxe/Image/Image.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c 
b/MdeModulePkg/Core/Dxe/Image/Image.c
index 9dbfb2a1fad22ced..2f2dfe5d0496dc4f 100644
--- a/MdeModulePkg/Core/Dxe/Image/Image.c
+++ b/MdeModulePkg/Core/Dxe/Image/Image.c
@@ -560,7 +560,6 @@ CoreIsImageTypeSupported (
   @param  Pe32Handle              The handle of PE32 image
   @param  Image                   PE image to be loaded
   @param  DstBuffer               The buffer to store the image
-  @param  EntryPoint              A pointer to the entry point
   @param  Attribute               The bit mask of attributes to set for the 
load
                                   PE image
 
@@ -577,7 +576,6 @@ CoreLoadPeImage (
   IN VOID                       *Pe32Handle,
   IN LOADED_IMAGE_PRIVATE_DATA  *Image,
   IN EFI_PHYSICAL_ADDRESS       DstBuffer    OPTIONAL,
-  OUT EFI_PHYSICAL_ADDRESS      *EntryPoint  OPTIONAL,
   IN  UINT32                    Attribute
   )
 {
@@ -810,13 +808,6 @@ CoreLoadPeImage (
     }
   }
 
-  //
-  // Fill in the entry point of the image if it is available
-  //
-  if (EntryPoint != NULL) {
-    *EntryPoint = Image->ImageContext.EntryPoint;
-  }
-
   //
   // Print the load address and the PDB file name if it is available
   //
@@ -1111,7 +1102,6 @@ CoreUnloadAndCloseImage (
                                   this parameter contains the required number.
   @param  ImageHandle             Pointer to the returned image handle that is
                                   created when the image is successfully 
loaded.
-  @param  EntryPoint              A pointer to the entry point
   @param  Attribute               The bit mask of attributes to set for the 
load
                                   PE image
 
@@ -1134,6 +1124,7 @@ CoreUnloadAndCloseImage (
                                   platform policy specifies that the image 
should not be started.
 
 **/
+STATIC
 EFI_STATUS
 CoreLoadImageCommon (
   IN  BOOLEAN                   BootPolicy,
@@ -1144,7 +1135,6 @@ CoreLoadImageCommon (
   IN  EFI_PHYSICAL_ADDRESS      DstBuffer           OPTIONAL,
   IN OUT UINTN                  *NumberOfPages      OPTIONAL,
   OUT EFI_HANDLE                *ImageHandle,
-  OUT EFI_PHYSICAL_ADDRESS      *EntryPoint         OPTIONAL,
   IN  UINT32                    Attribute
   )
 {
@@ -1375,9 +1365,9 @@ CoreLoadImageCommon (
   }
 
   //
-  // Load the image.  If EntryPoint is Null, it will not be set.
+  // Load the image.
   //
-  Status = CoreLoadPeImage (BootPolicy, &FHand, Image, DstBuffer, EntryPoint, 
Attribute);
+  Status = CoreLoadPeImage (BootPolicy, &FHand, Image, DstBuffer, Attribute);
   if (EFI_ERROR (Status)) {
     if ((Status == EFI_BUFFER_TOO_SMALL) || (Status == EFI_OUT_OF_RESOURCES)) {
       if (NumberOfPages != NULL) {
@@ -1559,7 +1549,6 @@ CoreLoadImage (
              (EFI_PHYSICAL_ADDRESS)(UINTN)NULL,
              NULL,
              ImageHandle,
-             NULL,
              EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION | 
EFI_LOAD_PE_IMAGE_ATTRIBUTE_DEBUG_IMAGE_INFO_TABLE_REGISTRATION
              );
 
-- 
2.39.2



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


Reply via email to