[edk2-devel] [edk2-platforms][PATCH v1 5/5] MinPlatformPkg/TestPointCheckLib: Make OutTable parameter optional
Nate DeSimone
nathaniel.l.desimone at intel.com
Thu Aug 5 23:15:30 UTC 2021
Reviewed-by: Nate DeSimone <nathaniel.l.desimone at intel.com>
> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Michael
> Kubacki
> Sent: Thursday, August 5, 2021 7:57 AM
> To: devel at edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu at intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone at intel.com>; Liming Gao
> <gaoliming at byosoft.com.cn>; Dong, Eric <eric.dong at intel.com>
> Subject: [edk2-devel] [edk2-platforms][PATCH v1 5/5]
> MinPlatformPkg/TestPointCheckLib: Make OutTable parameter optional
>
> From: Michael Kubacki <michael.kubacki at microsoft.com>
>
> Makes the OutTable parameter in DumpAcpiRsdt() and DumpAcpiXsdt()
> optional since the pointer passed can be NULL if the Signature pointer is also
> NULL.
>
> Can fix a potential failure in TestPointCheckAcpi().
>
> Cc: Chasel Chiu <chasel.chiu at intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone at intel.com>
> Cc: Liming Gao <gaoliming at byosoft.com.cn>
> Cc: Eric Dong <eric.dong at intel.com>
> Signed-off-by: Michael Kubacki <michael.kubacki at microsoft.com>
> ---
>
> Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckA
> cpi.c | 32 ++++++++++----------
> 1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git
> a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
> Acpi.c
> b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
> Acpi.c
> index cd8f538f7f3f..3d75e5012a4c 100644
> ---
> a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
> Acpi.c
> +++
> b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh
> +++ eckAcpi.c
> @@ -477,7 +477,7 @@ DumpAcpiTable (
> )
> {
> EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt;
> -
> +
> if (Table == NULL) {
> return ;
> }
> @@ -535,7 +535,7 @@ CheckAcpiTableResource (
> )
> {
> EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt;
> -
> +
> if (Table == NULL) {
> return EFI_INVALID_PARAMETER;
> }
> @@ -592,7 +592,7 @@ EFI_STATUS
> DumpAcpiRsdt (
> IN EFI_ACPI_DESCRIPTION_HEADER *Rsdt,
> IN UINT32 *Signature, OPTIONAL
> - OUT VOID **OutTable,
> + OUT VOID **OutTable, OPTIONAL
> IN BOOLEAN DumpPrint,
> IN BOOLEAN CheckResource
> )
> @@ -610,7 +610,7 @@ DumpAcpiRsdt (
>
> if (OutTable != NULL) {
> *OutTable = NULL;
> - } else {
> + } else if ((OutTable == NULL) && (Signature != NULL)) {
> return EFI_INVALID_PARAMETER;
> }
>
> @@ -632,7 +632,7 @@ DumpAcpiRsdt (
> *OutTable = Table;
> }
> }
> -
> +
> if (OutTable != NULL) {
> if (*OutTable == NULL) {
> return EFI_NOT_FOUND;
> @@ -646,7 +646,7 @@ EFI_STATUS
> DumpAcpiXsdt (
> IN EFI_ACPI_DESCRIPTION_HEADER *Xsdt,
> IN UINT32 *Signature, OPTIONAL
> - OUT VOID **OutTable,
> + OUT VOID **OutTable, OPTIONAL
> IN BOOLEAN DumpPrint,
> IN BOOLEAN CheckResource
> )
> @@ -662,16 +662,16 @@ DumpAcpiXsdt (
> if (Xsdt == NULL) {
> return EFI_INVALID_PARAMETER;
> }
> -
> +
> if (OutTable != NULL) {
> *OutTable = NULL;
> - } else {
> + } else if ((OutTable == NULL) && (Signature != NULL)) {
> return EFI_INVALID_PARAMETER;
> }
>
> ReturnStatus = EFI_SUCCESS;
> EntryCount = (Xsdt->Length - sizeof (EFI_ACPI_DESCRIPTION_HEADER)) /
> sizeof(UINT64);
> -
> +
> BasePtr = (UINTN)(Xsdt + 1);
> for (Index = 0; Index < EntryCount; Index ++) {
> CopyMem (&EntryPtr, (VOID *)(BasePtr + Index * sizeof(UINT64)),
> sizeof(UINT64)); @@ -783,7 +783,7 @@ TestPointCheckAcpi (
> if (Status == EFI_NOT_FOUND) {
> Status = DumpAcpiWithGuid (&gEfiAcpi10TableGuid, NULL, NULL, TRUE,
> FALSE);
> }
> -
> +
> if (EFI_ERROR(Status)) {
> DEBUG ((DEBUG_ERROR, "No ACPI table\n"));
> TestPointLibAppendErrorString (
> @@ -796,7 +796,7 @@ TestPointCheckAcpi (
> }
>
> DEBUG ((DEBUG_INFO, "==== TestPointCheckAcpi - Exit\n"));
> -
> +
> return Status;
> }
>
> @@ -806,9 +806,9 @@ TestPointCheckAcpiGcdResource (
> )
> {
> EFI_STATUS Status;
> -
> +
> DEBUG ((DEBUG_INFO, "==== TestPointCheckAcpiGcdResource -
> Enter\n"));
> -
> +
> //
> // Check the ACPI existence
> //
> @@ -816,7 +816,7 @@ TestPointCheckAcpiGcdResource (
> if (Status == EFI_NOT_FOUND) {
> Status = DumpAcpiWithGuid (&gEfiAcpi10TableGuid, NULL, NULL, FALSE,
> FALSE);
> }
> -
> +
> if (!EFI_ERROR(Status)) {
> //
> // Then check resource in ACPI and GCD @@ -828,7 +828,7 @@
> TestPointCheckAcpiGcdResource (
> Status = DumpAcpiWithGuid (&gEfiAcpi10TableGuid, NULL, NULL, FALSE,
> TRUE);
> }
> }
> -
> +
> if (EFI_ERROR(Status)) {
> DEBUG ((DEBUG_ERROR, "ACPI table resource not in GCD\n"));
> TestPointLibAppendErrorString (
> @@ -840,7 +840,7 @@ TestPointCheckAcpiGcdResource (
> );
> }
> DEBUG ((DEBUG_INFO, "==== TestPointCheckAcpiGcdResource - Exit\n"));
> -
> +
> return Status;
> }
>
> --
> 2.28.0.windows.1
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#78715): https://edk2.groups.io/g/devel/message/78715
> Mute This Topic: https://groups.io/mt/84686310/1767664
> Group Owner: devel+owner at edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [nathaniel.l.desimone at intel.com]
> -=-=-=-=-=-=
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78763): https://edk2.groups.io/g/devel/message/78763
Mute This Topic: https://groups.io/mt/84686310/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list