From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=chandni.cherukuri@arm.com; receiver=edk2-devel@lists.01.org Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id AA805211958E1 for ; Tue, 4 Dec 2018 03:36:31 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 58E3780D; Tue, 4 Dec 2018 03:36:31 -0800 (PST) Received: from usa.arm.com (a73437-lin.blr.arm.com [10.162.0.155]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 145233F59C; Tue, 4 Dec 2018 03:36:29 -0800 (PST) From: Chandni Cherukuri To: edk2-devel@lists.01.org Date: Tue, 4 Dec 2018 17:06:17 +0530 Message-Id: <1543923378-16820-2-git-send-email-chandni.cherukuri@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543923378-16820-1-git-send-email-chandni.cherukuri@arm.com> References: <1543923378-16820-1-git-send-email-chandni.cherukuri@arm.com> Subject: [PATCH edk2-platforms 1/2] Platform/ARM/Sgi: fix incorrect check of config-id value 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: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 X-List-Received-Date: Tue, 04 Dec 2018 11:36:31 -0000 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. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chandni Cherukuri --- 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