From 324931009e68b5019b2eafe57f3726825de01331 Mon Sep 17 00:00:00 2001 From: Sami Mujawar Date: Mon, 21 Sep 2020 16:57:59 +0100 Subject: [PATCH] DynamicTablesPkg: SsdtSerialPortLibArm fix ECC error Fix the following ECC reported error in SsdtSerialPortLibArm. - [5007] There should be no initialization of a variable as part of its declaration Variable Name. Signed-off-by: Sami Mujawar Reviewed-by: Alexei Fedorov --- .../Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c index a705d771be..6a1e7487df 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c @@ -171,7 +171,7 @@ BuildSsdtSerialPortTableEx ( CM_ARM_SERIAL_PORT_INFO * SerialPortInfo; UINT32 SerialPortCount; UINTN Index; - CHAR8 NewName[] = "COMx"; + CHAR8 NewName[5]; UINT64 Uid; EFI_ACPI_DESCRIPTION_HEADER ** TableList; @@ -243,6 +243,10 @@ BuildSsdtSerialPortTableEx ( // can be done in case of failure. *Table = TableList; + NewName[0] = 'C'; + NewName[1] = 'O'; + NewName[2] = 'M'; + NewName[4] = '\0'; for (Index = 0; Index < SerialPortCount; Index++) { Uid = SERIAL_PORT_START_UID + Index; NewName[3] = AsciiFromHex ((UINT8)(Uid)); -- 2.39.2