From 1307dcd745881377355a2e7fba53ff9184e92657 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Tue, 9 Oct 2007 07:08:08 +0000 Subject: Add compiler hint of "GLOBAL_REMOVE_IF_UNREFERENCED" to prevent component name structures linked into final image if PcdComponentNameDisabled or PcdComponentName2Disabled is set to TRUE. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4057 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Console/ConPlatformDxe/ComponentName.c | 8 +++--- .../Console/ConSplitterDxe/ComponentName.c | 32 +++++++++++----------- .../Console/GraphicsConsoleDxe/ComponentName.c | 8 +++--- .../Universal/Console/TerminalDxe/ComponentName.c | 8 +++--- 4 files changed, 28 insertions(+), 28 deletions(-) (limited to 'MdeModulePkg/Universal/Console') diff --git a/MdeModulePkg/Universal/Console/ConPlatformDxe/ComponentName.c b/MdeModulePkg/Universal/Console/ConPlatformDxe/ComponentName.c index 9a34e41..6010f22 100644 --- a/MdeModulePkg/Universal/Console/ConPlatformDxe/ComponentName.c +++ b/MdeModulePkg/Universal/Console/ConPlatformDxe/ComponentName.c @@ -27,20 +27,20 @@ Abstract: // // EFI Component Name Protocol // -EFI_COMPONENT_NAME_PROTOCOL gConPlatformComponentName = { +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gConPlatformComponentName = { ConPlatformComponentNameGetDriverName, ConPlatformComponentNameGetControllerName, "eng" - }; +}; // // EFI Component Name 2 Protocol // -EFI_COMPONENT_NAME2_PROTOCOL gConPlatformComponentName2 = { +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gConPlatformComponentName2 = { (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) ConPlatformComponentNameGetDriverName, (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) ConPlatformComponentNameGetControllerName, "en" - }; +}; STATIC EFI_UNICODE_STRING_TABLE mConPlatformDriverNameTable[] = { diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ComponentName.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ComponentName.c index 20dba84..6a45843 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ComponentName.c +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ComponentName.c @@ -22,77 +22,77 @@ Abstract: // // EFI Component Name Protocol // -EFI_COMPONENT_NAME_PROTOCOL gConSplitterConInComponentName = { +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gConSplitterConInComponentName = { ConSplitterComponentNameGetDriverName, ConSplitterConInComponentNameGetControllerName, "eng" - }; +}; // // EFI Component Name 2 Protocol // -EFI_COMPONENT_NAME2_PROTOCOL gConSplitterConInComponentName2 = { +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gConSplitterConInComponentName2 = { (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) ConSplitterComponentNameGetDriverName, (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) ConSplitterConInComponentNameGetControllerName, "en" - }; +}; // // EFI Component Name Protocol // -EFI_COMPONENT_NAME_PROTOCOL gConSplitterSimplePointerComponentName = { +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gConSplitterSimplePointerComponentName = { ConSplitterComponentNameGetDriverName, ConSplitterSimplePointerComponentNameGetControllerName, "eng" - }; +}; // // EFI Component Name 2 Protocol // -EFI_COMPONENT_NAME2_PROTOCOL gConSplitterSimplePointerComponentName2 = { +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gConSplitterSimplePointerComponentName2 = { (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) ConSplitterComponentNameGetDriverName, (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) ConSplitterSimplePointerComponentNameGetControllerName, "en" - }; +}; // // EFI Component Name Protocol // -EFI_COMPONENT_NAME_PROTOCOL gConSplitterConOutComponentName = { +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gConSplitterConOutComponentName = { ConSplitterComponentNameGetDriverName, ConSplitterConOutComponentNameGetControllerName, "eng" - }; +}; // // EFI Component Name 2 Protocol // -EFI_COMPONENT_NAME2_PROTOCOL gConSplitterConOutComponentName2 = { +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gConSplitterConOutComponentName2 = { (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) ConSplitterComponentNameGetDriverName, (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) ConSplitterConOutComponentNameGetControllerName, "en" - }; +}; // // EFI Component Name Protocol // -EFI_COMPONENT_NAME_PROTOCOL gConSplitterStdErrComponentName = { +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gConSplitterStdErrComponentName = { ConSplitterComponentNameGetDriverName, ConSplitterStdErrComponentNameGetControllerName, "eng" - }; +}; // // EFI Component Name 2 Protocol // -EFI_COMPONENT_NAME2_PROTOCOL gConSplitterStdErrComponentName2 = { +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gConSplitterStdErrComponentName2 = { (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) ConSplitterComponentNameGetDriverName, (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) ConSplitterStdErrComponentNameGetControllerName, "en" - }; +}; static EFI_UNICODE_STRING_TABLE mConSplitterDriverNameTable[] = { diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/ComponentName.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/ComponentName.c index 465acab..7c458ba 100644 --- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/ComponentName.c +++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/ComponentName.c @@ -22,20 +22,20 @@ Abstract: // // EFI Component Name Protocol // -EFI_COMPONENT_NAME_PROTOCOL gGraphicsConsoleComponentName = { +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gGraphicsConsoleComponentName = { GraphicsConsoleComponentNameGetDriverName, GraphicsConsoleComponentNameGetControllerName, "eng" - }; +}; // // EFI Component Name 2 Protocol // -EFI_COMPONENT_NAME2_PROTOCOL gGraphicsConsoleComponentName2 = { +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gGraphicsConsoleComponentName2 = { (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) GraphicsConsoleComponentNameGetDriverName, (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) GraphicsConsoleComponentNameGetControllerName, "en" - }; +}; STATIC EFI_UNICODE_STRING_TABLE mGraphicsConsoleDriverNameTable[] = { diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/ComponentName.c b/MdeModulePkg/Universal/Console/TerminalDxe/ComponentName.c index 7e99b01..5bcc85b 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/ComponentName.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/ComponentName.c @@ -22,20 +22,20 @@ Abstract: // // EFI Component Name Protocol // -EFI_COMPONENT_NAME_PROTOCOL gTerminalComponentName = { +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gTerminalComponentName = { TerminalComponentNameGetDriverName, TerminalComponentNameGetControllerName, "eng" - }; +}; // // EFI Component Name 2 Protocol // -EFI_COMPONENT_NAME2_PROTOCOL gTerminalComponentName2 = { +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gTerminalComponentName2 = { (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) TerminalComponentNameGetDriverName, (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) TerminalComponentNameGetControllerName, "en" - }; +}; static EFI_UNICODE_STRING_TABLE mTerminalDriverNameTable[] = { -- cgit v1.1