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=xjsGM6DJ; spf=pass (domain: arm.com, ip: 40.107.6.46, mailfrom: krzysztof.koch@arm.com) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.46]) by groups.io with SMTP; Thu, 18 Jul 2019 03:05:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g8Lk2hynOxuS2gutifkq471NXD+Fk508uZYpRrPlobJA01dY97QJz0i9aRBXFHG79d0xVRNUjENlyeIzFn60VNbJ00tgIiwchPhNw5GDWyYL6mdIC86BQCI9ffliN7FLu3kl+YA1GP0i1yGEVtMhkDqyGfZ4CY2KeihkVOu2ddnTWBVNYTwoMUibohRINAWF5qAE96wIKH3cw4UvJpGpKGrWqJyFp399kW41TLrwoAewtsfwkU8QxcYStGZrWqNx7K9PU2/rvZ/hLP9jxBTyRUN7j4yLiOsjwe3/8mc7PtlamusnSmjw5VIyIUnnnTkmCV1VzCrklp0Ymz0fm0Pcwg== 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=XalO7w01F4EPs/I/IVSzRAAgBz0y8y9FU3/YJC+cTMI=; b=dfypPTat8NuAgJHar9DRDgfE8kLkt2Fq0IjjmnBYrtiJLWfxPsvT1WbzivBe8J4Rgkkhk+2n/xgOsQ4yvQvnjAQH7IAEV4Mb1TdI5AN98tUjV5D1IEqsVQ4XttE80ApHw3+cWKvVW8ntk/7EKne5IwRMaFFDwsQndQA7GlBNGD2/MKIj9m7aMB8u3UYLdqqfrSlWRxaQP+aD0DSRWfY+7jq9P80qYZy+JUxH2uWs0G8PW/rYpTXlyeWSajSXsgylxoQV87ocnnUKkTHvDRjHh9JG5s1cfh74YxRhwc7P99HGap6+xwoYeI0H9QgWEQODoB4FhrxMjZdSKVZBkF6+DA== 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=XalO7w01F4EPs/I/IVSzRAAgBz0y8y9FU3/YJC+cTMI=; b=xjsGM6DJnONh7xbdbJc4hZyp9nKAy/WNkRJasQhtl+TiNv6fxJDc/K2xUDfOz533x//HpHorPNZtxPZ/fiZQ5m6Qoo6umP6VYAKw1c6M4V0xB3UDINedz+AIoE4z9naEiQx9/UIGVev9nwrlbqHd1K1I/VlhiYSqvTQ/JYsmP9k= Received: from VI1PR08CA0157.eurprd08.prod.outlook.com (2603:10a6:800:d1::11) by AM0PR08MB4945.eurprd08.prod.outlook.com (2603:10a6:208:157::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.10; Thu, 18 Jul 2019 10:05:36 +0000 Received: from DB5EUR03FT021.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::204) by VI1PR08CA0157.outlook.office365.com (2603:10a6:800:d1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2094.11 via Frontend Transport; Thu, 18 Jul 2019 10:05:36 +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 DB5EUR03FT021.mail.protection.outlook.com (10.152.20.238) 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:34 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) 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:13 +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:13 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [PATCH v1 4/8] ShellPkg: acpiview: SRAT: Remove redundant forward declarations Date: Thu, 18 Jul 2019 11:04:58 +0100 Message-ID: <20190718100502.24688-5-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)(39860400002)(396003)(376002)(136003)(346002)(2980300002)(189003)(199004)(2351001)(486006)(2906002)(86362001)(53416004)(126002)(16586007)(5660300002)(2616005)(476003)(53936002)(68736007)(50466002)(11346002)(4326008)(316002)(44832011)(47776003)(8936002)(70586007)(54906003)(446003)(6916009)(63350400001)(1076003)(305945005)(36756003)(63370400001)(70206006)(7696005)(426003)(336012)(50226002)(478600001)(51416003)(186003)(8676002)(26005)(356004)(6666004)(81156014)(76176011)(81166006)(48376002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR08MB4945;H:nebula.arm.com;FPR:;SPF:TempError;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41e81945-80b5-403d-46c0-08d70b677999 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328);SRVR:AM0PR08MB4945; X-MS-TrafficTypeDiagnostic: AM0PR08MB4945: 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: ol47iPM8wv6EqAUAOYoF+5ci4zfC3aw+CcV8P06jpuymuR7bnoDZT3Sa1sKKX7uuhjZTpZwybqQuuK1ht5FVBO4g4M3Z929zfzhO06HN256LH2SyuNTdlJd7QAFbmnrlUVTWhlsg4NrtmmomMgBOb+N2P/bXN9lXC0OHApN4DAqffN+j+5YOCePkiRS26VeNYCrWampA22M1bIjBJmNqboedUK1xRR0zoMOH2vs/k25U2AGzEbYbQOrunTnRlkU09oc9mzIo3G5arPLe0xn5kxknDLGxgzdY1uhHw+lLE5W+p6CPpmiCgFlpjcfnaFgTe0qtWzU06Vj6YLKkkBp2f9FHu8phP/sTsXPEfr83Oauxo8oRvD6gPAeCM6r2ZHkq2myuoORmtVJfIWSucdzjYBzNKGrveiEcSvUh39EXGmE= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2019 10:05:34.5719 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41e81945-80b5-403d-46c0-08d70b677999 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: AM0PR08MB4945 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/Srat/SratParser.c | 64 ++++++-------------- 1 file changed, 18 insertions(+), 46 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c index 075ff2a141a82b522e8aaedb7ad79249aaf5eaac..03d28d52842040e4872e204fc10ae3dba7861936 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c @@ -1,7 +1,7 @@ /** @file SRAT 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): @@ -32,7 +32,13 @@ EFIAPI ValidateSratReserved ( IN UINT8* Ptr, IN VOID* Context - ); + ) +{ + if (*(UINT32*)Ptr != 1) { + IncrementErrorCount (); + Print (L"\nERROR: Reserved should be 1 for backward compatibility.\n"); + } +} /** This function traces the APIC Proximity Domain field. @@ -44,9 +50,16 @@ STATIC VOID EFIAPI DumpSratApicProximity ( - IN CONST CHAR16* Format, - IN UINT8* Ptr - ); + IN CONST CHAR16* Format, + IN UINT8* Ptr + ) +{ + UINT32 ProximityDomain; + + ProximityDomain = Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16); + + Print (Format, ProximityDomain); +} /** An ACPI_PARSER array describing the SRAT Table. @@ -139,47 +152,6 @@ STATIC CONST ACPI_PARSER SratX2ApciAffinityParser[] = { {L"Reserved", 4, 20, L"0x%x", NULL, NULL, NULL, NULL} }; -/** This function validates the Reserved field in the SRAT table header. - - @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 -ValidateSratReserved ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ - if (*(UINT32*)Ptr != 1) { - IncrementErrorCount (); - Print (L"\nERROR: Reserved should be 1 for backward compatibility.\n"); - } -} - -/** - This function traces the APIC Proximity Domain field. - - @param [in] Format Format string for tracing the data. - @param [in] Ptr Pointer to the start of the buffer. -**/ -STATIC -VOID -EFIAPI -DumpSratApicProximity ( - IN CONST CHAR16* Format, - IN UINT8* Ptr - ) -{ - UINT32 ProximityDomain; - - ProximityDomain = Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16); - - Print (Format, ProximityDomain); -} - /** This function parses the ACPI SRAT table. When trace is enabled this function parses the SRAT table and -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'