From nobody Sat Apr 20 05:15:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43643+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1562914412; cv=none; d=zoho.com; s=zohoarc; b=Va2GZmw/R8MmZvlMF4rpalLD3UXBj6xwo7RlCzcP+oVn9ibw9TfhUYpA2Cq16rPOtTwPoo479X9qqAEeixERY86+6k5uro/VFsN4MymrORGc0ijJRcAGrdqKJVetsxkqSsnLV8+AGBEENVxDqst4rYNxKcSABHgJdZ6eDuo2Qdg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562914412; h=Content-Type:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=cIMucT399fScsiXoixT4z3q48oyI7P8LDCk5bikce3s=; b=VGBbp6mkcHfPEpd8pQlA+8detvPhzs0wvCSegxLZQ9FkzeNWqqej8ieSwCxRutrAm9PkjrwvtYzx+ay1ZwPwk53QxzDq1rpSivKfzWxyTWj2KxXH/qriNfJjQbHGGP3zEEY8FGJTy4dmUSMOpoK+VPRlAtpM9o1ZZQ1qt/+hkio= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43643+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1562914412439877.3760669870979; Thu, 11 Jul 2019 23:53:32 -0700 (PDT) Return-Path: X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.53]) by groups.io with SMTP; Thu, 11 Jul 2019 23:53:31 -0700 X-Received: from VI1PR08CA0148.eurprd08.prod.outlook.com (2603:10a6:800:d5::26) by DB8PR08MB4954.eurprd08.prod.outlook.com (2603:10a6:10:bf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.18; Fri, 12 Jul 2019 06:53:27 +0000 X-Received: from DB5EUR03FT040.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::203) by VI1PR08CA0148.outlook.office365.com (2603:10a6:800:d5::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2073.11 via Frontend Transport; Fri, 12 Jul 2019 06:53:27 +0000 Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43643+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT040.mail.protection.outlook.com (10.152.20.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2052.18 via Frontend Transport; Fri, 12 Jul 2019 06:53:25 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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; Fri, 12 Jul 2019 06:53:16 +0000 X-Received: from E119924.Arm.com (10.37.8.167) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Fri, 12 Jul 2019 06:53:16 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [edk2-devel] [PATCH v1 02/11] ShellPkg: acpiview: SPCR: Remove redundant forward declaration Date: Fri, 12 Jul 2019 07:52:34 +0100 Message-ID: <20190712065243.3812-3-krzysztof.koch@arm.com> In-Reply-To: <20190712065243.3812-1-krzysztof.koch@arm.com> References: <20190712065243.3812-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e8600ba-9fd5-4e1d-b6c5-08d70695a380 X-MS-TrafficTypeDiagnostic: DB8PR08MB4954: X-MS-Exchange-PUrlCount: 1 X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:2657; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: g0+fxBlLBxSpJLJDOBUaLVx2fWDPAaPiEVu7eZkdQSkKsmUgeqEa3YAsmb9VPVmCM4jN91zooNy9LQGMKWzP2dL4OGmxn6ZTGD5KPxPrwFLaLu1Msh4UiH/vR7IOBR7G6KPml+3pLEWUwQ55DmxOh0M6gQTdLUrVgHxTIhfAHOWUC+tH53UftPcETViS4xTvEoyFzwfPzy9qzTo1DoTTccFfXLRgbsO+Gl3xtMRHAdyCHt7AutmGM7UCBLaCHw07m4COhu42f12bfoULt8bMLmWGZzOVBzjT816LKfn+UWVweUxisvv4+tc9vT6AjCwPp98cgUXvVakyhevirWxwMIDfhWo/IpAsQQHjnNoeUTk2iTr1cZd3zoZMMHGSvYkDTcMSPSd2dDSzPcOR3w4Z5QY2F6MVpA+8GaD4/NAJBYs= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2019 06:53:25.9109 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6e8600ba-9fd5-4e1d-b6c5-08d70695a380 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: DB8PR08MB4954 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,krzysztof.koch@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1562914412; bh=fOlJcqoaM4nV35W+LD1YwDFStjEHxddrlVNGYfpSBHA=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=d5jbiu06oBKohi3+bkeAagQrtmL1pU3vI4wVbHJuweTHipaVoYpEQhwAOkAn1b78YW7 XQXdCLBBh08KicNSWmJZT9S1rpDGflQBPyW4gG+Nm8ZqYBRBTZG9uw8DqOumuidD3qiS8 y/x5YZOCGlicvJHvje20S8ENJX3ufFU7BsA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Reposition blocks of code to remove redundant forward function declarations in order to reduce the code size. Signed-off-by: Krzysztof Koch Reviewed-by: Alexei Fedorov --- Changes can be seen at: https://github.com/KrzysztofKoch1/edk2/commit/9be55= a64f804c3d99e7c692208c8086d5b9ca553 Notes: v1: - remove redundant forward declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParser.c | 9= 8 +++++++------------- 1 file changed, 34 insertions(+), 64 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/Spcr= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrPa= rser.c index 1974a9c046e4a3bccccc55cf758184af097b2420..3b06b05dee8c056c6e009b9e485= ccd35d4194e95 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 =20 - 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 =20 @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 =3D *Ptr; + + if (InterruptType !=3D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC)= { + IncrementErrorCount (); + Print ( + L"\nERROR: InterruptType =3D %d. This must be 8 on ARM Platforms", + InterruptType + ); + } +#endif +} =20 /** 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 =3D *Ptr; + + if (Irq !=3D 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: Irq =3D %d. This must be zero on ARM Platforms\n", + Irq + ); + } +#endif +} =20 /** An ACPI_PARSER array describing the ACPI SPCR Table. @@ -76,67 +107,6 @@ STATIC CONST ACPI_PARSER SpcrParser[] =3D { {L"Reserved", 4, 76, L"%x", NULL, NULL, NULL, NULL} }; =20 -/** - 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 =3D *Ptr; - - if (InterruptType !=3D - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC)= { - IncrementErrorCount (); - Print ( - L"\nERROR: InterruptType =3D %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 =3D *Ptr; - - if (Irq !=3D 0) { - IncrementErrorCount (); - Print ( - L"\nERROR: Irq =3D %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)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#43643): https://edk2.groups.io/g/devel/message/43643 Mute This Topic: https://groups.io/mt/32439504/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-