[edk2] [Patch 3/3] UefiCpuPkg/RegisterCpuFeaturesLib: Remove useless function.

Ni, Ruiyu ruiyu.ni at intel.com
Wed Dec 19 18:03:12 PST 2018


Nice cleanup.
Reviewed-by: Ruiyu Ni <Ruiyu.ni at intel.com>

Thanks/Ray

> -----Original Message-----
> From: Dong, Eric <eric.dong at intel.com>
> Sent: Thursday, December 20, 2018 9:16 AM
> To: edk2-devel at lists.01.org
> Cc: Ni, Ruiyu <ruiyu.ni at intel.com>; Laszlo Ersek <lersek at redhat.com>
> Subject: [Patch 3/3] UefiCpuPkg/RegisterCpuFeaturesLib: Remove useless
> function.
> 
> Directly call the API instead of create function for it.
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1411
> 
> Cc: Ruiyu Ni <ruiyu.ni at intel.com>
> Cc: Laszlo Ersek <lersek at redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Dong <eric.dong at intel.com>
> ---
>  .../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,
> --
> 2.15.0.windows.1



More information about the edk2-devel mailing list