[edk2] [PATCH v3 6/6] ArmPlatformPkg/ArmJunoDxe: simplify ACPI table installation

Ard Biesheuvel posted 6 patches 7 years, 7 months ago
There is a newer version of this series
[edk2] [PATCH v3 6/6] ArmPlatformPkg/ArmJunoDxe: simplify ACPI table installation
Posted by Ard Biesheuvel 7 years, 7 months ago
Having a three way conditional with callbacks would make sense if the
callbacks weren't (a) identical and (b) didn't return TRUE all the
time. So get rid of the kludge.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c | 37 +-------------------
 1 file changed, 1 insertion(+), 36 deletions(-)

diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
index f7e33961b4e7..da93eb582909 100644
--- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
+++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
@@ -400,34 +400,6 @@ OnEndOfDxe (
   }
 }
 
-STATIC
-BOOLEAN
-AcpiTableJunoR0Check (
-  IN  EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader
-  )
-{
-  return TRUE;
-}
-
-STATIC
-BOOLEAN
-AcpiTableJunoR1Check (
-  IN  EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader
-  )
-{
-  return TRUE;
-}
-
-STATIC
-BOOLEAN
-AcpiTableJunoR2Check (
-  IN  EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader
-  )
-{
-  return TRUE;
-}
-
-
 EFI_STATUS
 EFIAPI
 ArmJunoEntryPoint (
@@ -517,14 +489,7 @@ ArmJunoEntryPoint (
   //
   // Try to install the ACPI Tables
   //
-  if (JunoRevision == JUNO_REVISION_R0) {
-    Status = LocateAndInstallAcpiFromFvConditional (&mJunoAcpiTableFile, AcpiTableJunoR0Check);
-  } else if (JunoRevision == JUNO_REVISION_R1) {
-    Status = LocateAndInstallAcpiFromFvConditional (&mJunoAcpiTableFile, AcpiTableJunoR1Check);
-  } else if (JunoRevision == JUNO_REVISION_R2) {
-    Status = LocateAndInstallAcpiFromFvConditional (&mJunoAcpiTableFile, AcpiTableJunoR2Check);
-  }
-
+  Status = LocateAndInstallAcpiFromFv (&mJunoAcpiTableFile);
   ASSERT_EFI_ERROR (Status);
 
   //
-- 
2.9.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v3 6/6] ArmPlatformPkg/ArmJunoDxe: simplify ACPI table installation
Posted by Leif Lindholm 7 years, 7 months ago
On Tue, Apr 04, 2017 at 01:30:10PM +0100, Ard Biesheuvel wrote:
> Having a three way conditional with callbacks would make sense if the
> callbacks weren't (a) identical and (b) didn't return TRUE all the
> time. So get rid of the kludge.
> 

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c | 37 +-------------------
>  1 file changed, 1 insertion(+), 36 deletions(-)
> 
> diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
> index f7e33961b4e7..da93eb582909 100644
> --- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
> +++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
> @@ -400,34 +400,6 @@ OnEndOfDxe (
>    }
>  }
>  
> -STATIC
> -BOOLEAN
> -AcpiTableJunoR0Check (
> -  IN  EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader
> -  )
> -{
> -  return TRUE;
> -}
> -
> -STATIC
> -BOOLEAN
> -AcpiTableJunoR1Check (
> -  IN  EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader
> -  )
> -{
> -  return TRUE;
> -}
> -
> -STATIC
> -BOOLEAN
> -AcpiTableJunoR2Check (
> -  IN  EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader
> -  )
> -{
> -  return TRUE;
> -}
> -
> -
>  EFI_STATUS
>  EFIAPI
>  ArmJunoEntryPoint (
> @@ -517,14 +489,7 @@ ArmJunoEntryPoint (
>    //
>    // Try to install the ACPI Tables
>    //
> -  if (JunoRevision == JUNO_REVISION_R0) {
> -    Status = LocateAndInstallAcpiFromFvConditional (&mJunoAcpiTableFile, AcpiTableJunoR0Check);
> -  } else if (JunoRevision == JUNO_REVISION_R1) {
> -    Status = LocateAndInstallAcpiFromFvConditional (&mJunoAcpiTableFile, AcpiTableJunoR1Check);
> -  } else if (JunoRevision == JUNO_REVISION_R2) {
> -    Status = LocateAndInstallAcpiFromFvConditional (&mJunoAcpiTableFile, AcpiTableJunoR2Check);
> -  }
> -
> +  Status = LocateAndInstallAcpiFromFv (&mJunoAcpiTableFile);
>    ASSERT_EFI_ERROR (Status);
>  
>    //
> -- 
> 2.9.3
> 
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel