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=M53T4zG3; spf=pass (domain: arm.com, ip: 40.107.0.40, mailfrom: krzysztof.koch@arm.com) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (EUR02-AM5-obe.outbound.protection.outlook.com [40.107.0.40]) by groups.io with SMTP; Thu, 18 Jul 2019 03:05:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hnq6qqX44qW4FgjfeF7wxXTI9nNBM0SWrnTlTYW15/gIx+rXdm29hkS3IyqAM+qLodmDcyyccwZjfKl9XpiRq2k2ITNETpHulL2MTsXOIjyVOEkZpZx3JkxlX65NKiXIg9RRx5PeM1eBYRQPoqcBm4pN32Pbx6gJKuEr2F1iyn+MQajB9PE0V6d7JV/JJmklD/V73ljhU8BNmDcDUvLiyNT4Jj2Zg0BKwREdVsXEMQ+G7YP9r19Ar9eob6oXDamSY/hv5U2EjT2GQBt8DCRcv87hYWL4x1B3SanvMlrAPBobqqNB0LwG7KOjsXHIjQ+/hGrcUa4YPeWU/qxnEYPyRg== 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=TKxnZqmi2pvSiwxcetNwONkRZuwrD8tfRxaAtJo3+XI=; b=MZOa+mQsfdOYxVY+0X/hyepcsbtwn8vfhaUzyf0G5aWkPZnED9jNs5OFUhXSH4pxmPutcy59TqlX/SHTfQ836h4PaBO4UWUYMMt85AP7BVhd6q08Mc31r3r7shtBIXvZxoYffd0PI1C+XJQXYFxcMYpJXGodKet2anJtnzJLx6iJsfQig3hvICMuVi9tiF2CjNWUoTVhC1ZzKV2FZthF3t60gXzDRMj9mP+pL2cgeLNDyk1OGAXJrTPHS6bJvfGGQwMrW06NWKD/tJSl+ZbCWICppWB8YIdUy5PTXmY+iSWT7TyBCIj5LLtADGSRlVKLF41QnIaBiL/eGKkDxbk+UQ== 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=TKxnZqmi2pvSiwxcetNwONkRZuwrD8tfRxaAtJo3+XI=; b=M53T4zG31s6V4CYe71AtCihXGD7/x4kqg4KWJ/ep7nbzfbZJOb3gdc6lRNCcuyEZkYoWBUCdAU4p5hiRNzjAohpNLwFaikTO1S8CNPu60dxxymIQ95K6knUWdpcyGNOMKPo3tNBPHvzUiirIaiKzRcvOsKlaoNsMJTz8QP7WE8I= Received: from HE1PR0802CA0016.eurprd08.prod.outlook.com (2603:10a6:3:bd::26) by AM0PR08MB4947.eurprd08.prod.outlook.com (2603:10a6:208:158::20) 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:05:42 +0000 Received: from DB5EUR03FT050.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::200) by HE1PR0802CA0016.outlook.office365.com (2603:10a6:3:bd::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2073.14 via Frontend Transport; Thu, 18 Jul 2019 10:05:42 +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 DB5EUR03FT050.mail.protection.outlook.com (10.152.21.128) 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:05:38 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) 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 3/8] ShellPkg: acpiview: SPCR: Remove redundant forward declaration Date: Thu, 18 Jul 2019 11:04:57 +0100 Message-ID: <20190718100502.24688-4-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)(396003)(346002)(39860400002)(136003)(376002)(2980300002)(199004)(189003)(2616005)(476003)(48376002)(446003)(2351001)(54906003)(44832011)(86362001)(486006)(70586007)(11346002)(6666004)(53416004)(63350400001)(81166006)(16586007)(81156014)(426003)(356004)(50466002)(1076003)(76176011)(70206006)(36756003)(63370400001)(126002)(2906002)(305945005)(336012)(5660300002)(316002)(26005)(50226002)(47776003)(53936002)(7696005)(51416003)(8936002)(6916009)(478600001)(4326008)(14444005)(8676002)(186003)(68736007);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR08MB4947;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: 590a7556-1758-4258-1556-08d70b677bcd X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328);SRVR:AM0PR08MB4947; X-MS-TrafficTypeDiagnostic: AM0PR08MB4947: 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: e+Ej7nKTqzhZtLtIU3BNVzHzRiUvBJuIpoUAJRTQ5gN6CiYzwUu3u6001cJ5Fvyb6cN74ePTU2mTLTNV08JaTNOBp2u75PyvvPqDIht08CCVhm4ciEDqyCXWB0iKk2KT/80gKlw0nH06U3bsypCwoixuSL0PkxiW4X0EddzRaFYRNYWwYWvBQYAUBDD9AF9G4929kAItjqirDoW9ADj+7RWEiTnLErFoAfxyS13zxiRtVV9Cqo893n46GmxigoZCJz3X+Os1kTu7QwNUlOHRGssje0BW1g1tlXiZc/81N/3a3Pa2gvfVxYHB4uSAGMqruo6wsB7uoOBcB5z8UCoSv0zAD0zOAjw3KI+WMuRpn3TVQhS+T5DSomOqwM3sN1k7/22x9zlCyjVXzhHUzITNQmdQKuWvvI7Rd3Oh4wfFwe0= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2019 10:05:38.2659 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 590a7556-1758-4258-1556-08d70b677bcd 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: AM0PR08MB4947 Content-Type: text/plain Reposition blocks of code to remove redundant forward function declarations in order to reduce the code size. Signed-off-by: Krzysztof Koch --- Notes: v1: - remove redundant forward function declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParser.c | 98 +++++++------------- 1 file changed, 34 insertions(+), 64 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParser.c index 1974a9c046e4a3bccccc55cf758184af097b2420..3b06b05dee8c056c6e009b9e485ccd35d4194e95 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParser.c @@ -1,7 +1,7 @@ /** @file SPCR 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): @@ -31,7 +31,23 @@ EFIAPI ValidateInterruptType ( IN UINT8* Ptr, IN VOID* Context - ); + ) +{ +#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + UINT8 InterruptType; + + InterruptType = *Ptr; + + if (InterruptType != + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC) { + IncrementErrorCount (); + Print ( + L"\nERROR: InterruptType = %d. This must be 8 on ARM Platforms", + InterruptType + ); + } +#endif +} /** This function validates the Irq. @@ -46,7 +62,22 @@ EFIAPI ValidateIrq ( IN UINT8* Ptr, IN VOID* Context - ); + ) +{ +#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + UINT8 Irq; + + Irq = *Ptr; + + if (Irq != 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: Irq = %d. This must be zero on ARM Platforms\n", + Irq + ); + } +#endif +} /** An ACPI_PARSER array describing the ACPI SPCR Table. @@ -76,67 +107,6 @@ STATIC CONST ACPI_PARSER SpcrParser[] = { {L"Reserved", 4, 76, L"%x", NULL, NULL, NULL, NULL} }; -/** - This function validates the Interrupt Type. - - @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 -ValidateInterruptType ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ -#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) - UINT8 InterruptType; - - InterruptType = *Ptr; - - if (InterruptType != - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC) { - IncrementErrorCount (); - Print ( - L"\nERROR: InterruptType = %d. This must be 8 on ARM Platforms", - InterruptType - ); - } -#endif -} - -/** - This function validates the Irq. - - @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 -ValidateIrq ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ -#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) - UINT8 Irq; - - Irq = *Ptr; - - if (Irq != 0) { - IncrementErrorCount (); - Print ( - L"\nERROR: Irq = %d. This must be zero on ARM Platforms\n", - Irq - ); - } -#endif -} - /** This function parses the ACPI SPCR table. When trace is enabled this function parses the SPCR table and -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'