]> git.proxmox.com Git - mirror_edk2.git/commitdiff
DynamicTablesPkg: SsdtSerialPortLibArm fix ECC error
authorSami Mujawar <sami.mujawar@arm.com>
Mon, 21 Sep 2020 15:57:59 +0000 (16:57 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 21 Oct 2020 13:33:03 +0000 (13:33 +0000)
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 <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c

index a705d771be1a2d59c4b0f645269eb838ff605a1a..6a1e7487dfaf4ceb2e074e52cef2fc30bfce7152 100644 (file)
@@ -171,7 +171,7 @@ BuildSsdtSerialPortTableEx (
   CM_ARM_SERIAL_PORT_INFO       * SerialPortInfo;\r
   UINT32                          SerialPortCount;\r
   UINTN                           Index;\r
-  CHAR8                           NewName[] = "COMx";\r
+  CHAR8                           NewName[5];\r
   UINT64                          Uid;\r
   EFI_ACPI_DESCRIPTION_HEADER  ** TableList;\r
 \r
@@ -243,6 +243,10 @@ BuildSsdtSerialPortTableEx (
   // can be done in case of failure.\r
   *Table = TableList;\r
 \r
+  NewName[0] = 'C';\r
+  NewName[1] = 'O';\r
+  NewName[2] = 'M';\r
+  NewName[4] = '\0';\r
   for (Index = 0; Index < SerialPortCount; Index++) {\r
     Uid = SERIAL_PORT_START_UID + Index;\r
     NewName[3] = AsciiFromHex ((UINT8)(Uid));\r