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.web11.46672.1685355447197056921 for ; Mon, 29 May 2023 03:17:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DsxxauJ2; 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 B68196101A; Mon, 29 May 2023 10:17:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB398C433A4; Mon, 29 May 2023 10:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685355446; bh=MM/N0oNrfsVnasZkXXdeR1tUJalXtBQtSsqJXF4ri+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DsxxauJ2XGxb1GKbwQXRo6uqrnq+9s6MktqGygIUl7NOti1KMVMvURKrSuYWrp/EK 7d5ZBIHA1CHdP/Df5epyFFnIZB7zB43wZibs1HSdJqxp6LZCnC9j5kef0KTVU5rzim i2tgmqRDrENmQiDxAu4PitXUAouIE2qIj27J5ZfEgcqNPyAFLP5nLt+mCDT2nm0sc8 ks7ycdjjRxOKopuusEkIHgDCma2lpSPeA+13pbMcZTXVH0ZGF6+EuLmHeQbi/iZZzt INDO5186AJYt3pEROzU1/M3pfgCBRUEXlDn0aDJQtnqTY4XsfTTbh0osM4yDGu0uup SwZmHMVnelC5Q== 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 03/11] MdeModulePkg/DxeCore: Remove FreePage argument from CoreUnloadImage Date: Mon, 29 May 2023 12:16:57 +0200 Message-Id: <20230529101705.2476949-4-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 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 --- 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/Im= age/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.=0D =0D @param Image EFI image=0D - @param FreePage Free allocated pages=0D =0D **/=0D +STATIC=0D VOID=0D CoreUnloadAndCloseImage (=0D - IN LOADED_IMAGE_PRIVATE_DATA *Image,=0D - IN BOOLEAN FreePage=0D + IN LOADED_IMAGE_PRIVATE_DATA *Image=0D )=0D {=0D EFI_STATUS Status;=0D @@ -1022,7 +1021,7 @@ CoreUnloadAndCloseImage ( //=0D // Free the Image from memory=0D //=0D - if ((Image->ImageBasePage !=3D 0) && FreePage) {=0D + if (Image->ImageBasePage !=3D 0) {=0D CoreFreePages (Image->ImageBasePage, Image->NumberOfPages);=0D }=0D =0D @@ -1413,7 +1412,7 @@ CoreLoadImageCommon ( //=0D if (EFI_ERROR (Status)) {=0D if (Image !=3D NULL) {=0D - CoreUnloadAndCloseImage (Image, TRUE);=0D + CoreUnloadAndCloseImage (Image);=0D Image =3D NULL;=0D }=0D } else if (EFI_ERROR (SecurityStatus)) {=0D @@ -1711,7 +1710,7 @@ CoreStartImage ( // unload it=0D //=0D if (EFI_ERROR (Image->Status) || (Image->Type =3D=3D EFI_IMAGE_SUBSYSTEM= _EFI_APPLICATION)) {=0D - CoreUnloadAndCloseImage (Image, TRUE);=0D + CoreUnloadAndCloseImage (Image);=0D //=0D // ImageHandle may be invalid after the image is unloaded, so use NULL= handle to record perf log.=0D //=0D @@ -1776,7 +1775,7 @@ CoreExit ( //=0D // The image has not been started so just free its resources=0D //=0D - CoreUnloadAndCloseImage (Image, TRUE);=0D + CoreUnloadAndCloseImage (Image);=0D Status =3D EFI_SUCCESS;=0D goto Done;=0D }=0D @@ -1874,7 +1873,7 @@ CoreUnloadImage ( //=0D // if the Image was not started or Unloaded O.K. then clean up=0D //=0D - CoreUnloadAndCloseImage (Image, TRUE);=0D + CoreUnloadAndCloseImage (Image);=0D }=0D =0D Done:=0D --=20 2.39.2