From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D6D4321A02937 for ; Wed, 26 Dec 2018 14:04:01 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43AACA403A; Wed, 26 Dec 2018 22:04:01 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-121-136.rdu2.redhat.com [10.10.121.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id F0D2F608DD; Wed, 26 Dec 2018 22:03:59 +0000 (UTC) To: Eric Dong , edk2-devel@lists.01.org Cc: Ruiyu Ni References: <20181224021236.12976-1-eric.dong@intel.com> <20181224021236.12976-3-eric.dong@intel.com> From: Laszlo Ersek Message-ID: <306755e8-a2c9-baa7-7b2f-59230577c6b2@redhat.com> Date: Wed, 26 Dec 2018 23:03:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181224021236.12976-3-eric.dong@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 26 Dec 2018 22:04:01 +0000 (UTC) Subject: Re: [Patch v2 2/2] UefiCpuPkg/RegisterCpuFeaturesLib: Remove useless function. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 22:04:02 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 12/24/18 03:12, Eric Dong wrote: > Directly call the API instead of create function for it. > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1411 > > Cc: Ruiyu Ni > Cc: Laszlo Ersek > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Eric Dong > Reviewed-by: Ruiyu Ni > --- > .../PeiRegisterCpuFeaturesLib.c | 35 +++++----------------- > 1 file changed, 8 insertions(+), 27 deletions(-) > > diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.c > index 0bbcb50181..fdd0791c89 100644 > --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.c > +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.c > @@ -67,32 +67,6 @@ GetCpuFeaturesData ( > return CpuInitData; > } > > -/** > - Worker function to get MP PPI service pointer. > - > - @return PEI PPI service pointer. > -**/ > -EFI_PEI_MP_SERVICES_PPI * > -GetMpPpi ( > - VOID > - ) > -{ > - EFI_STATUS Status; > - EFI_PEI_MP_SERVICES_PPI *CpuMpPpi; > - > - // > - // Get MP Services Protocol > - // > - Status = PeiServicesLocatePpi ( > - &gEfiPeiMpServicesPpiGuid, > - 0, > - NULL, > - (VOID **)&CpuMpPpi > - ); > - ASSERT_EFI_ERROR (Status); > - return CpuMpPpi; > -} > - > /** > Worker function to return processor index. > > @@ -139,7 +113,14 @@ GetProcessorInformation ( > EFI_PEI_MP_SERVICES_PPI *CpuMpPpi; > EFI_STATUS Status; > > - CpuMpPpi = GetMpPpi (); > + Status = PeiServicesLocatePpi ( > + &gEfiPeiMpServicesPpiGuid, > + 0, > + NULL, > + (VOID **)&CpuMpPpi > + ); > + ASSERT_EFI_ERROR (Status); > + > Status = CpuMpPpi->GetProcessorInfo ( > GetPeiServicesTablePointer(), > CpuMpPpi, > Reviewed-by: Laszlo Ersek