From 9439da565e280199469f82db159ea1616a715a25 Mon Sep 17 00:00:00 2001 From: Hao Wu Date: Wed, 18 Mar 2015 00:45:50 +0000 Subject: 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 Reviewed-by: Liming Gao Reviewed-by: Michael Kinney git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17061 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Bus/Isa/IsaSerialDxe/ComponentName.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'IntelFrameworkModulePkg/Bus') diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/ComponentName.c b/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/ComponentName.c index 9e98973c03..4b17c5423c 100644 --- a/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/ComponentName.c +++ b/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/ComponentName.c @@ -1,7 +1,7 @@ /** @file UEFI Component Name and Name2 protocol for Isa serial driver. -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials 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 @@ -14,7 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "Serial.h" -#define SERIAL_PORT_NAME "ISA Serial Port # " // // 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. @@ -242,22 +243,19 @@ AddName ( IN EFI_ISA_IO_PROTOCOL *IsaIo ) { - CHAR16 SerialPortName[sizeof (SERIAL_PORT_NAME)]; - - StrCpy (SerialPortName, L"ISA Serial Port # "); - SerialPortName[sizeof (SERIAL_PORT_NAME) - 2] = (CHAR16) (L'0' + (UINT8) IsaIo->ResourceList->Device.UID); + mSerialPortName[(sizeof (mSerialPortName) / 2) - 2] = (CHAR16) (L'0' + (UINT8) IsaIo->ResourceList->Device.UID); AddUnicodeString2 ( "eng", gIsaSerialComponentName.SupportedLanguages, &SerialDevice->ControllerNameTable, - (CHAR16 *) SerialPortName, + mSerialPortName, TRUE ); AddUnicodeString2 ( "en", gIsaSerialComponentName2.SupportedLanguages, &SerialDevice->ControllerNameTable, - (CHAR16 *) SerialPortName, + mSerialPortName, FALSE ); -- cgit v1.2.3