IntelFrameworkModulePkg: Remove a duplicated hardcode string

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
This commit is contained in:
Hao Wu 2015-03-18 00:45:50 +00:00 committed by hwu1225
parent ec8a502e66
commit 9439da565e
1 changed files with 6 additions and 8 deletions

View File

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