[edk2] [PATCH edk2-platforms 1/2] Platform/ARM/Sgi: fix incorrect check of config-id value

Ard Biesheuvel ard.biesheuvel at linaro.org
Tue Dec 4 06:55:54 PST 2018


On Tue, 4 Dec 2018 at 12:36, Chandni Cherukuri
<chandni.cherukuri at arm.com> wrote:
>
> On SGI platform, the value of configuration ID can be zero.
> So avoid returning an error from the function that creates
> the system ID HOB in case the value of the configuration ID
> is zero.
>
> While at it, improve some of the error messages as well.
>

So the platform ID is still guaranteed to be non-zero?


> Cc: Ard Biesheuvel <ard.biesheuvel at linaro.org>
> Cc: Leif Lindholm <leif.lindholm at linaro.org>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Chandni Cherukuri <chandni.cherukuri at arm.com>
> ---
>  Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c b/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c
> index 15ea571..065b23d 100644
> --- a/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c
> +++ b/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c
> @@ -67,7 +67,7 @@ GetSgiSystemId (
>
>    Property = fdt_getprop (HwCfgDtBlob, Offset, "platform-id", NULL);
>    if (Property == NULL) {
> -    DEBUG ((DEBUG_ERROR, "Platform Id is NULL\n"));
> +    DEBUG ((DEBUG_ERROR, "platform-id property not found\n"));
>      return EFI_INVALID_PARAMETER;
>    }
>
> @@ -75,7 +75,7 @@ GetSgiSystemId (
>
>    Property = fdt_getprop (HwCfgDtBlob, Offset, "config-id", NULL);
>    if (Property == NULL) {
> -    DEBUG ((DEBUG_ERROR, "Config Id is NULL\n"));
> +    DEBUG ((DEBUG_ERROR, "config-id property not found\n"));
>      return EFI_INVALID_PARAMETER;
>    }
>
> @@ -121,7 +121,7 @@ SgiPlatformPeim (
>      return EFI_INVALID_PARAMETER;
>    }
>
> -  if (HobData->PlatformId == 0 || HobData->ConfigId == 0) {
> +  if (HobData->PlatformId == 0) {
>      ASSERT (FALSE);
>      return EFI_INVALID_PARAMETER;
>    }
> --
> 2.7.4
>


More information about the edk2-devel mailing list