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=gWVv4p7N; spf=pass (domain: arm.com, ip: 40.107.1.77, mailfrom: krzysztof.koch@arm.com) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (EUR02-HE1-obe.outbound.protection.outlook.com [40.107.1.77]) by groups.io with SMTP; Mon, 22 Jul 2019 00:50:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lm+cN0YzS9eawyC2ZO5BTp2aE3LeAxuUTejSc0rD7AvvtsOX7nWFtAlEw+PlrZCPo+ENoVoE8rFn90+kS4Rt+w63qmTMukPhbldYOQx5yP31Xjj7HoapTgBfd5IHJ/Kdh6JGsRr4d6e1rxAe/hyM86UiFyizO/6fdLEzb4gpC3UJwAnlI8y3LISBALzhmPQFUjRIRlUUDlXalT94jECurmvVKXv309vJb1+vua+m/fZnuLo6nMJk3pmCqqmsd8omBjDyZy0VOytsAVICG5NTA/c1+H3W+rrYm0jzNgdE3htDkP+Y8twwcsT29X/igpM2eb2YSjqZnR8PkfcAq/9CDQ== 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=ns2I0PA7Uwg13DOfaLj1Ve4iscBni/oqc8auQASW5Ak=; b=dcwaZeciRzl40/E6+wCbDQKwz29TseGhQKGw9/uNQLGhSiG7SF1H21HmvM00e58VVoUREYeFXd7KClLQvee4lrnySs39b88dmtkaIA6Wfp6drsn+1uf2hLxzqM8X2Tb6rj/E7QgT8RkGL9QYpSk4UkgUPv7di5Obeinyl3vJbNDdl8Gus2EZcnXNHOlHng3VLHU5hIlRr4HCeRI8C2ft8GDQ8zikW+9EmDMkapxifJ8Zx9Ph8X9l2Gv/xlsDL2QuQZ0p5TE9ovGyT3/aHG5W+JSYd/mBmLmCK+hxh6Hh5iBm/JMNMpwv/9xfvngX5p39tm/lBPC6c6OPIcPJAwopFQ== 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=ns2I0PA7Uwg13DOfaLj1Ve4iscBni/oqc8auQASW5Ak=; b=gWVv4p7N2vCGDb0uKWINrETVrqYzGvbCuGBIwR82NcH+30SYmExZaYtZW1ZJ+PKEcTkqMqT4PGLkl+EQBxQFMIgwPhvaLNElz2pKE+kjdt9PdLfFTF9sPHSlqMUkO71Kve1UcCGIg5FiV2FQ3SorCkkqo4Z8PS8NePj0soKPmDU= Received: from AM4PR08CA0068.eurprd08.prod.outlook.com (2603:10a6:205:2::39) by DB8PR08MB4953.eurprd08.prod.outlook.com (2603:10a6:10:ef::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.17; Mon, 22 Jul 2019 07:50:38 +0000 Received: from AM5EUR03FT020.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::208) by AM4PR08CA0068.outlook.office365.com (2603:10a6:205:2::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2094.14 via Frontend Transport; Mon, 22 Jul 2019 07:50:38 +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 AM5EUR03FT020.mail.protection.outlook.com (10.152.16.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2052.18 via Frontend Transport; Mon, 22 Jul 2019 07:50:37 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1415.2; Mon, 22 Jul 2019 07:50:36 +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; Mon, 22 Jul 2019 07:50:36 +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; Mon, 22 Jul 2019 07:50:35 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [PATCH v2 2/6] ShellPkg: acpiview: XSDT: Remove redundant ParseAcpi() call Date: Mon, 22 Jul 2019 08:50:22 +0100 Message-ID: <20190722075026.20244-3-krzysztof.koch@arm.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20190722075026.20244-1-krzysztof.koch@arm.com> References: <20190722075026.20244-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)(39860400002)(346002)(376002)(396003)(2980300002)(189003)(199004)(305945005)(6916009)(316002)(4326008)(446003)(26005)(81166006)(426003)(11346002)(81156014)(63370400001)(63350400001)(186003)(1076003)(16586007)(336012)(70206006)(86362001)(70586007)(54906003)(476003)(6666004)(8676002)(356004)(48376002)(5660300002)(126002)(36756003)(50466002)(486006)(2906002)(2351001)(44832011)(53936002)(51416003)(7696005)(68736007)(50226002)(76176011)(2616005)(478600001)(53416004)(47776003)(8936002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB8PR08MB4953;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: 98b4e73c-1e23-45a1-8eca-08d70e794907 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328);SRVR:DB8PR08MB4953; X-MS-TrafficTypeDiagnostic: DB8PR08MB4953: X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 01068D0A20 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: GGVMXdLUAIkrb/gbbRAF5lh8pYs5GTN1RrtKiQtmihzcsxXlefB8tQWtZnqV6oNFzO4Ect8GekVZR82vXfg4pZsdm4GIR7BvG4I76oA29CIQsbHouEB79yCJWIHoVC3QHpxiJg88KO0iUoQrxq85HO2D1NUhv+Uvp51ne6GPE6rOWAluYUPWVI9OZ5gveew+cn4Abu0smGvxxg+HYM5KitUGEJvPnJEl8cgWTmMZoWeOHGx2xw7+/hKBjUeN/WCSunx7Sz+J8eTi8BtZtBF8aLb1bOz1yeGF2OXLPVGiUnIhDhNP5UDCrjW+xLtBrfNFb0x49t73RE+aZCtCqGATpV2u3itgpZZxxSAaGQ5VRc5/SQt0eQWZgnYT5Gc07EEazeUVXhhB49DuhdlZVWWqww9Z7din8lq8HeE3l2HNeVY= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2019 07:50:37.4147 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 98b4e73c-1e23-45a1-8eca-08d70e794907 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: DB8PR08MB4953 Content-Type: text/plain Remove a call to ParseAcpi() responsible for getting the XSDT table length. This call is not needed because the ACPI table buffer length is provided as an input argument to the ParseAcpiXsdt() function. Modify remaining code to use the AcpiTableLength argument of the ParseAcpiXsdt() function instead of a global static variable. Signed-off-by: Krzysztof Koch --- Notes: v1: - remove redundant ParseAcpi() call [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c index 4196168bff47d70c67f79f3fc1f4cdee302d460e..e39061f8e2612f2cce4aebf51a511b63b703662b 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c @@ -1,7 +1,7 @@ /** @file XSDT 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): @@ -60,22 +60,12 @@ ParseAcpiXsdt ( UINTN EntryIndex; CHAR16 Buffer[32]; - // Parse the ACPI header to get the length - ParseAcpi ( - FALSE, - 0, - "XSDT", - Ptr, - ACPI_DESCRIPTION_HEADER_LENGTH, - PARSER_PARAMS (XsdtParser) - ); - Offset = ParseAcpi ( Trace, 0, "XSDT", Ptr, - *AcpiHdrInfo.Length, + AcpiTableLength, PARSER_PARAMS (XsdtParser) ); @@ -84,7 +74,7 @@ ParseAcpiXsdt ( if (Trace) { EntryIndex = 0; TablePointer = (UINT64*)(Ptr + TableOffset); - while (Offset < (*AcpiHdrInfo.Length)) { + while (Offset < AcpiTableLength) { CONST UINT32* Signature; CONST UINT32* Length; CONST UINT8* Revision; @@ -140,7 +130,7 @@ ParseAcpiXsdt ( // Process the tables Offset = TableOffset; TablePointer = (UINT64*)(Ptr + TableOffset); - while (Offset < (*AcpiHdrInfo.Length)) { + while (Offset < AcpiTableLength) { if ((UINT64*)(UINTN)(*TablePointer) != NULL) { ProcessAcpiTable ((UINT8*)(UINTN)(*TablePointer)); } -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'