From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web10.46498.1685355441481519688 for ; Mon, 29 May 2023 03:17:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oS8l46Kk; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0E02961336; Mon, 29 May 2023 10:17:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15AAEC433EF; Mon, 29 May 2023 10:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685355440; bh=agRVjgP1Suf2dVizUPzeXko9eQpZdyVzDtKrLIIb6B4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oS8l46KkiebI0daLhYRR3uFVn1HxkiGiknWqHlu4sVmzdtPRfRyNTIZ6EY+adKqAv C3iKyRnVEzw7VB/ydapDYZD+7SGL42uQzGSlV+yIYINWFScKonPdrnqPiYaxDaNFli /QDxFTWIQ2hwe6u71ybLaM5Wp74AnK9IxaNIDFoPAI2vwJ/myD4JNbF7u858ozkzl4 TTN0H255F4pZC374jtAYZh1GsMHN0nQfi2znlINSE9GhPllpDh8IZpW+cKmga2gQIB dmyuQ98C/Gt/db0YFfSfYuxGXxAHeLUL34lstxDcLofQpr5MgrAalKz8RQzFYAitRj PLy1FAlyO7zBg== From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Ray Ni , Jiewen Yao , Gerd Hoffmann , Taylor Beebe , Oliver Smith-Denny , Dandan Bi , Liming Gao , "Kinney, Michael D" , Leif Lindholm , Michael Kubacki Subject: [RFC PATCH 01/11] MdeModulePkg/DxeCore: Remove unused 'EntryPoint' argument to LoadImage Date: Mon, 29 May 2023 12:16:55 +0200 Message-Id: <20230529101705.2476949-2-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230529101705.2476949-1-ardb@kernel.org> References: <20230529101705.2476949-1-ardb@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 --- 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/Im= age/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=0D @param Image PE image to be loaded=0D @param DstBuffer The buffer to store the image=0D - @param EntryPoint A pointer to the entry point=0D @param Attribute The bit mask of attributes to set for th= e load=0D PE image=0D =0D @@ -577,7 +576,6 @@ CoreLoadPeImage ( IN VOID *Pe32Handle,=0D IN LOADED_IMAGE_PRIVATE_DATA *Image,=0D IN EFI_PHYSICAL_ADDRESS DstBuffer OPTIONAL,=0D - OUT EFI_PHYSICAL_ADDRESS *EntryPoint OPTIONAL,=0D IN UINT32 Attribute=0D )=0D {=0D @@ -810,13 +808,6 @@ CoreLoadPeImage ( }=0D }=0D =0D - //=0D - // Fill in the entry point of the image if it is available=0D - //=0D - if (EntryPoint !=3D NULL) {=0D - *EntryPoint =3D Image->ImageContext.EntryPoint;=0D - }=0D -=0D //=0D // Print the load address and the PDB file name if it is available=0D //=0D @@ -1111,7 +1102,6 @@ CoreUnloadAndCloseImage ( this parameter contains the required num= ber.=0D @param ImageHandle Pointer to the returned image handle tha= t is=0D created when the image is successfully l= oaded.=0D - @param EntryPoint A pointer to the entry point=0D @param Attribute The bit mask of attributes to set for th= e load=0D PE image=0D =0D @@ -1134,6 +1124,7 @@ CoreUnloadAndCloseImage ( platform policy specifies that the image= should not be started.=0D =0D **/=0D +STATIC=0D EFI_STATUS=0D CoreLoadImageCommon (=0D IN BOOLEAN BootPolicy,=0D @@ -1144,7 +1135,6 @@ CoreLoadImageCommon ( IN EFI_PHYSICAL_ADDRESS DstBuffer OPTIONAL,=0D IN OUT UINTN *NumberOfPages OPTIONAL,=0D OUT EFI_HANDLE *ImageHandle,=0D - OUT EFI_PHYSICAL_ADDRESS *EntryPoint OPTIONAL,=0D IN UINT32 Attribute=0D )=0D {=0D @@ -1375,9 +1365,9 @@ CoreLoadImageCommon ( }=0D =0D //=0D - // Load the image. If EntryPoint is Null, it will not be set.=0D + // Load the image.=0D //=0D - Status =3D CoreLoadPeImage (BootPolicy, &FHand, Image, DstBuffer, EntryP= oint, Attribute);=0D + Status =3D CoreLoadPeImage (BootPolicy, &FHand, Image, DstBuffer, Attrib= ute);=0D if (EFI_ERROR (Status)) {=0D if ((Status =3D=3D EFI_BUFFER_TOO_SMALL) || (Status =3D=3D EFI_OUT_OF_= RESOURCES)) {=0D if (NumberOfPages !=3D NULL) {=0D @@ -1559,7 +1549,6 @@ CoreLoadImage ( (EFI_PHYSICAL_ADDRESS)(UINTN)NULL,=0D NULL,=0D ImageHandle,=0D - NULL,=0D EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION | EFI_LOAD_P= E_IMAGE_ATTRIBUTE_DEBUG_IMAGE_INFO_TABLE_REGISTRATION=0D );=0D =0D --=20 2.39.2