[edk2-devel] [PATCH v1 2/7] DynamicTablesPkg: SsdtSerialPortLibArm fix ECC error

Sami Mujawar posted 7 patches 5 years, 4 months ago
[edk2-devel] [PATCH v1 2/7] DynamicTablesPkg: SsdtSerialPortLibArm fix ECC error
Posted by Sami Mujawar 5 years, 4 months ago
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>
---
 DynamicTablesPkg/Library/Acpi/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 a705d771be1a2d59c4b0f645269eb838ff605a1a..6a1e7487dfaf4ceb2e074e52cef2fc30bfce7152 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));
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#65450): https://edk2.groups.io/g/devel/message/65450
Mute This Topic: https://groups.io/mt/77014347/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v1 2/7] DynamicTablesPkg: SsdtSerialPortLibArm fix ECC error
Posted by Alexei Fedorov 5 years, 4 months ago
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#65459): https://edk2.groups.io/g/devel/message/65459
Mute This Topic: https://groups.io/mt/77014347/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-