X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=IntelFrameworkModulePkg%2FBus%2FIsa%2FIsaSerialDxe%2FComponentName.c;h=4b17c5423c643a72695dbeac18cd36a1905b7365;hb=9439da565e280199469f82db159ea1616a715a25;hp=146f30873e13636b458fc7bfc9b315a4c08e3f4e;hpb=180a5a35cb49699bd249dee19e41cee34c856a58;p=mirror_edk2.git diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/ComponentName.c b/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/ComponentName.c index 146f30873e..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 - 2009, 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. @@ -152,7 +153,7 @@ IsaSerialComponentNameGetDriverName ( driver specified by This was returned in DriverName. - @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. + @retval EFI_INVALID_PARAMETER ControllerHandle is NULL. @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE. @@ -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 );