From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=W/Cph7I9; spf=pass (domain: arm.com, ip: 40.107.15.79, mailfrom: krzysztof.koch@arm.com) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.79]) by groups.io with SMTP; Thu, 18 Jul 2019 03:06:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q6PFAtxXczFfuquteAn6eF1XHvfRpbPcr4tVAmHq83Cy2T1dCaEppV5vGxUy7tL/9yq4eYUNSRDHHapR9pNYF7y01b2GSwZ3/ibP923Xe6Ff7xusN8gz74QKPGQu054q8K8jBsSFm0p6cr1gdaonJR1uTfSyshDMwK+XuhHWKLC8UX0/nNgnrTpancWrBBe5xtHbvI40WTVoFL4JG6fxwt/UK4gL3VFbGOvdOG/cjmYcdmmUJuiTFaTJ1NkaL+WsnES/lIbOkLeVDpnpjzeRX6cDuOAeOW1tdPFy5GHdlTEmUz6lldhPmR3F1G+c50H4PaWcG3AelDW3C78VUcG0HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VM1GTyhqSZsYnoz8OWO6PxyEH2elrEBVOLQ9PsZTdzA=; b=iahaRwBgSniLMqOWKN66cek8JlmomMCsx24XTY3ieoVlVfJ57MeqB0ZacMNOfFaQM5SxxpI7oqqrkDLKXq9Ru60WDhOuunz4Jcruz86gBNF5adxYPZe85VrxSzTJbXbfP1kZvDlogHdAdMDim+hNAeyCz8F/Kh3DH0+8f/pqeGLHSoZc504jHETnOJ55Kr5BP3ufZsj5EY0EANxQwgNa6k78EgddJDvB+2jSKtIk2UuFzHMQJa0SQ7ezMTY9q+CctCopUTb9CvFmpnIB96BNr6YM865S0zZf9kEARgIs2DSPFfAMegofifVUBnmRlmFOC/CkbR2K4kQ4wnm1bDg3nQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com;dmarc=temperror action=none header.from=arm.com;dkim=none (message not signed);arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VM1GTyhqSZsYnoz8OWO6PxyEH2elrEBVOLQ9PsZTdzA=; b=W/Cph7I9RZ6VSLbpvC+TlbW3QurE6pgpUJiYiSY0de/zNryP9Jwom0pJ1g2s12sJi4ex6KWSvpx19oFJSSBY8+Mdsbz7Ht8T/Ue2ayie73U18FwfhbAFAgREBtAeTA6c0cj0cATEifce4FuvqZYjzbCte3pROGaCf/Ov48LfXvM= Received: from VI1PR0802CA0022.eurprd08.prod.outlook.com (2603:10a6:800:aa::32) by AM5PR0802MB2594.eurprd08.prod.outlook.com (2603:10a6:203:99::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Thu, 18 Jul 2019 10:06:32 +0000 Received: from DB5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::201) by VI1PR0802CA0022.outlook.office365.com (2603:10a6:800:aa::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2094.12 via Frontend Transport; Thu, 18 Jul 2019 10:06:32 +0000 Authentication-Results: spf=temperror (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT042.mail.protection.outlook.com (10.152.21.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2052.18 via Frontend Transport; Thu, 18 Jul 2019 10:06:30 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1415.2; Thu, 18 Jul 2019 10:05:13 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Thu, 18 Jul 2019 10:05:12 +0000 Received: from E119924.Arm.com (10.1.199.124) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 18 Jul 2019 10:05:12 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [PATCH v1 2/8] ShellPkg: acpiview: FADT: Remove redundant forward declarations Date: Thu, 18 Jul 2019 11:04:56 +0100 Message-ID: <20190718100502.24688-3-krzysztof.koch@arm.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20190718100502.24688-1-krzysztof.koch@arm.com> References: <20190718100502.24688-1-krzysztof.koch@arm.com> Return-Path: Krzysztof.Koch@arm.com MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:40.67.248.234;IPV:NLI;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(136003)(376002)(346002)(39860400002)(396003)(2980300002)(199004)(189003)(81166006)(2351001)(53416004)(486006)(44832011)(47776003)(81156014)(426003)(50226002)(36756003)(478600001)(316002)(8936002)(54906003)(68736007)(5660300002)(6666004)(63370400001)(476003)(126002)(76176011)(51416003)(7696005)(2616005)(336012)(2906002)(53936002)(26005)(186003)(11346002)(48376002)(86362001)(305945005)(8676002)(50466002)(16586007)(70206006)(4326008)(1076003)(70586007)(6916009)(356004)(63350400001)(446003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0802MB2594;H:nebula.arm.com;FPR:;SPF:TempError;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d342c29c-5ba7-45cc-425d-08d70b679b24 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328);SRVR:AM5PR0802MB2594; X-MS-TrafficTypeDiagnostic: AM5PR0802MB2594: X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 01026E1310 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: COiXxbOcXkR9P16E2GERPKZxnFNItk0YLs/mb5DOXyrCtHP6De/mcfmakyZMAXUsB3WyE3DHfMevn/pMGp8pFyM3UfvGv8JnXV0uG61kay6W8lbL44pVAgrSNak1sVemNaS5ig+aOaQO+z9zPrTEQUha1GPMlWDw6s+agvlb4F0hgapDJgGcw4SO3vtCzw+lZAokbxvv5Km1mdwzTY1drHWvtRT2Gubs22o6Qj1Y9ymIuTwe7eA1xuzv/6SS8/t6Z+SxkkLmFo0npniCnbXgOcVIqFmgbvAzTR1FfcSKZ/NjPeZxwHJPIVTufRDf4DyfWOh9NVBaqH8oRu2LOCTU20aipSifCMLf8G0CYAF3Tv66Gr7b5sa39faJJsNZ/y5G3o7Jg/TX4Uuo6WYLyqdw0XAyujZwXzAUDF2GktzEs/U= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2019 10:06:30.8466 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d342c29c-5ba7-45cc-425d-08d70b679b24 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[40.67.248.234];Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2594 Content-Type: text/plain Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Signed-off-by: Krzysztof Koch --- Notes: v1: - remove redundant forward function declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c | 113 ++++++-------------- 1 file changed, 34 insertions(+), 79 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c index cee7ee0770433da96d6042d2f5d687903f4b5495..e40c9ef8ee4b3285faf8c6edf3cb6236ee367397 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c @@ -1,7 +1,7 @@ /** @file FADT table parser - Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2019, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @par Reference(s): @@ -46,7 +46,17 @@ EFIAPI ValidateFirmwareCtrl ( IN UINT8* Ptr, IN VOID* Context - ); +) +{ +#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + if (*(UINT32*)Ptr != 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: Firmware Control must be zero for ARM platforms." + ); + } +#endif +} /** This function validates the X_Firmware Control Field. @@ -61,7 +71,17 @@ EFIAPI ValidateXFirmwareCtrl ( IN UINT8* Ptr, IN VOID* Context - ); +) +{ +#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + if (*(UINT64*)Ptr != 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: X Firmware Control must be zero for ARM platforms." + ); + } +#endif +} /** This function validates the flags. @@ -76,7 +96,17 @@ EFIAPI ValidateFlags ( IN UINT8* Ptr, IN VOID* Context - ); +) +{ +#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + if (((*(UINT32*)Ptr) & HW_REDUCED_ACPI) == 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: HW_REDUCED_ACPI flag must be set for ARM platforms." + ); + } +#endif +} /** An ACPI_PARSER array describing the ACPI FADT Table. @@ -142,81 +172,6 @@ STATIC CONST ACPI_PARSER FadtParser[] = { {L"Hypervisor VendorIdentity", 8, 268, L"%lx", NULL, NULL, NULL, NULL} }; -/** - This function validates the Firmware Control Field. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateFirmwareCtrl ( - IN UINT8* Ptr, - IN VOID* Context -) -{ -#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) - if (*(UINT32*)Ptr != 0) { - IncrementErrorCount (); - Print ( - L"\nERROR: Firmware Control must be zero for ARM platforms." - ); - } -#endif -} - -/** - This function validates the X_Firmware Control Field. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateXFirmwareCtrl ( - IN UINT8* Ptr, - IN VOID* Context -) -{ -#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) - if (*(UINT64*)Ptr != 0) { - IncrementErrorCount (); - Print ( - L"\nERROR: X Firmware Control must be zero for ARM platforms." - ); - } -#endif -} - -/** - This function validates the flags. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateFlags ( - IN UINT8* Ptr, - IN VOID* Context -) -{ -#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) - if (((*(UINT32*)Ptr) & HW_REDUCED_ACPI) == 0) { - IncrementErrorCount (); - Print ( - L"\nERROR: HW_REDUCED_ACPI flag must be set for ARM platforms." - ); - } -#endif -} - /** This function parses the ACPI FADT table. This function parses the FADT table and optionally traces the ACPI table fields. -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'