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=ty96Yelr; spf=permerror, err=parse error for token &{10 18 _spf-b.arm.com}: parse error for token &{10 18 spf.protection.outlook.com}: parse error for token &{10 18 spfa.protection.outlook.com}: parse error for token &{10 18 spfb.protection.outlook.com}: limit exceeded (domain: arm.com, ip: , mailfrom: krzysztof.koch@arm.com) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com []) by groups.io with SMTP; Thu, 18 Jul 2019 05:31:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CLrxuVZYQVxneOVBaDHMk2ELEqqDLjiZOHW8vmMT/qpzl13bBGzWJx87qFQW578YIJ0ew8wx3dts77JNR74g+igZh97CbeUJW+6uuCf6YixQfyTprmqt1vxr6li66TcXl+Zceja1k3QF3MOmu1ccb2uedH2RBDCSjvwdJacXa/4YpRxbFDbJQFICXS+mvWvDG9m4SD1JgoRnrKfGEJvRRH8T9/HXA47xTDwwZSufifKoP/zM/WBQiEb22+21MHSobyGNe+Q6uFjSy4UJlxwF1RJ4iNJbafFomwwE0RZA8iS5xtjO4NpRmhGcvhNhDa1R7aIvjf2l01XtYRSKAt8uBA== 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=RBSVgUvNk7s2FGNwJC2cZ77Hj2N4uPUGs99LCEtAduRBjLEzShgi8cN59eYuA5Kws14HNzfKbEBN5lsy1kTn4Pxlk6hoF9Y1BpZUeaN72YadcyUzpfFIET+BbySsCZ/2M2rCDMtihfiDwgsmTZVYoQ2+anTBFtzHX0b/CvvshYFoa4gcw+MObYIkl8NyIDepwWmaLlHXb+gU/sYzpLwSCkZupUUqX9mumbWxl/Q3wFKRvlWmZHEvdoqtWBAQP4oBJdxAL5S8nosPJ3DiGfyIhmjbwbvpTneYlalgPZcvEbakHu8hbcbi6B7oFCa4lgNQoILZg/YnHdlkDm28WocA9g== 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=ty96YelrnVDjI1TKs+WhK+YLqb0TOpbCje2ntXq81Ut8Jqn8RxJIYHFYFX9UnwMI6aSLMBtzmsJ49H9N21pbNCAHxt+sQ8go1WYqxVrGF0WAAkdO+oI2L5qoUBjb4pkPp9pS3J7pVlOWAZiSXv3sD2BZmY5MLjqB9Xa/5oCXlPo= Received: from VI1PR08CA0096.eurprd08.prod.outlook.com (10.175.228.22) by DB6PR0802MB2600.eurprd08.prod.outlook.com (10.172.251.150) 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 12:31:55 +0000 Received: from AM5EUR03FT041.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::209) by VI1PR08CA0096.outlook.office365.com (2603:10a6:800:d3::22) 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 12:31:55 +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 AM5EUR03FT041.mail.protection.outlook.com (10.152.17.186) 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 12:31:53 +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 12:31:51 +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 12:31:51 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [PATCH v1 2/6] ShellPkg: acpiview: XSDT: Remove redundant ParseAcpi() call Date: Thu, 18 Jul 2019 13:31:38 +0100 Message-ID: <20190718123142.5696-3-krzysztof.koch@arm.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20190718123142.5696-1-krzysztof.koch@arm.com> References: <20190718123142.5696-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)(376002)(136003)(346002)(396003)(39860400002)(2980300002)(199004)(189003)(47776003)(2906002)(356004)(6666004)(5660300002)(76176011)(186003)(4326008)(1076003)(7696005)(53416004)(6916009)(26005)(54906003)(486006)(51416003)(16586007)(48376002)(86362001)(476003)(2351001)(8676002)(44832011)(336012)(8936002)(50226002)(68736007)(426003)(63370400001)(53936002)(81166006)(63350400001)(446003)(81156014)(70586007)(316002)(2616005)(478600001)(70206006)(126002)(305945005)(11346002)(36756003)(50466002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0802MB2600;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: 761da0f9-0be0-4539-6e38-08d70b7bea94 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328);SRVR:DB6PR0802MB2600; X-MS-TrafficTypeDiagnostic: DB6PR0802MB2600: X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 01026E1310 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 28Y1ChZDyN+lUfzpUnS6Jv0nyZiPJuNf/Hcbg6nz4BhFhg3sZ3+3AnlE84JMKbratfiQ3Q2TVuqxeCY0IyIjwS2DrINwVgQGzhpAnsM5WEAi8JtW8zf9oobxUpy7WgrsUmUoT4S6n5jD4EUPCdkxIoKG8QxG+m/Z9GWoEv/AG9lKLfhf0bIP2kGIfBrnQO8G6tPyO1iVwUbEWGPi+qU+SKIvT8730xYzdDDqNgccDEjLJA6xM1z3E6zuwVEZMQBP7odvUGPoY7iGLRlls3v3MSvEkdexFpbtasEmzIq6DorCT/M4NzumPJ41G7CIhtOoqxf22DB0x4niQNUT0QuxpmngZbSR76/nSHhdaD5oLjGSJzOHShXicL74S976jatlPDTRlfgeD0mmjEj2Uw8xzQVSHIyIUcj1d98/jOarfFo= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2019 12:31:53.9362 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 761da0f9-0be0-4539-6e38-08d70b7bea94 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: DB6PR0802MB2600 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)'