]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelFrameworkModulePkg: Remove a duplicated hardcode string
authorHao Wu <hao.a.wu@intel.com>
Wed, 18 Mar 2015 00:45:50 +0000 (00:45 +0000)
committerhwu1225 <hwu1225@Edk2>
Wed, 18 Mar 2015 00:45:50 +0000 (00:45 +0000)
Removed a hardcode UNICODE string in IsaSerialDxe.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <Michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17061 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/ComponentName.c

index 9e98973c03933f14cd4bed261f996b5990a2859d..4b17c5423c643a72695dbeac18cd36a1905b7365 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Component Name and Name2 protocol for Isa serial driver.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -14,7 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "Serial.h"\r
 \r
-#define SERIAL_PORT_NAME  "ISA Serial Port # "\r
 //\r
 // EFI Component Name Protocol\r
 //\r
@@ -45,6 +44,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIsaSerialDriverNameTable
   }\r
 };\r
 \r
+GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 mSerialPortName[] = L"ISA Serial Port # ";\r
+\r
 /**\r
   Retrieves a Unicode string that is the user readable name of the driver.\r
 \r
@@ -242,22 +243,19 @@ AddName (
   IN  EFI_ISA_IO_PROTOCOL                      *IsaIo\r
   )\r
 {\r
-  CHAR16  SerialPortName[sizeof (SERIAL_PORT_NAME)];\r
-\r
-  StrCpy (SerialPortName, L"ISA Serial Port # ");\r
-  SerialPortName[sizeof (SERIAL_PORT_NAME) - 2] = (CHAR16) (L'0' + (UINT8) IsaIo->ResourceList->Device.UID);\r
+  mSerialPortName[(sizeof (mSerialPortName) / 2) - 2] = (CHAR16) (L'0' + (UINT8) IsaIo->ResourceList->Device.UID);\r
   AddUnicodeString2 (\r
     "eng",\r
     gIsaSerialComponentName.SupportedLanguages,\r
     &SerialDevice->ControllerNameTable,\r
-    (CHAR16 *) SerialPortName,\r
+    mSerialPortName,\r
     TRUE\r
     );\r
   AddUnicodeString2 (\r
     "en",\r
     gIsaSerialComponentName2.SupportedLanguages,\r
     &SerialDevice->ControllerNameTable,\r
-    (CHAR16 *) SerialPortName,\r
+    mSerialPortName,\r
     FALSE\r
     );\r
 \r