From 7538d53684792266c37e91f11a3ce2b7fb1e32d9 Mon Sep 17 00:00:00 2001 From: jljusten Date: Mon, 31 Oct 2011 15:58:05 +0000 Subject: MdeModulePkg: Remove variables that are set, but not used GCC 4.6 generates a warning when a variable is set, but never used. Signed-off-by: jljusten Reviewed-by: lgao4 Reviewed-by: erictian Reviewed-by: rsun3 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12617 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlString.c | 8 ++------ MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c | 6 ------ MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c | 17 ++--------------- MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 13 ++++++------- MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 3 +-- 5 files changed, 11 insertions(+), 36 deletions(-) (limited to 'MdeModulePkg/Universal') diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlString.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlString.c index fe2c7613e5..9f47b48835 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlString.c +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlString.c @@ -1,7 +1,7 @@ /** @file ACPI Sdt Protocol Driver - Copyright (c) 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2011, 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 @@ -117,9 +117,7 @@ AmlGetNameStringSize ( UINTN SegCount; UINTN Length; UINTN Index; - UINT8 *Name; - Name = Buffer; Length = 0; // @@ -493,9 +491,7 @@ AmlPrintNameString ( { UINT8 SegCount; UINT8 Index; - UINT8 *Name; - - Name = Buffer; + if (*Buffer == AML_ROOT_CHAR) { // // RootChar diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c index b6621a93e2..37a592ce90 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c @@ -662,7 +662,6 @@ AppendAltCfgString ( ) { EFI_STRING StringPtr; - EFI_STRING TmpPtr; UINTN Length; UINT8 *TmpBuffer; UINTN Offset; @@ -683,11 +682,6 @@ AppendAltCfgString ( } while (*StringPtr != 0 && StrnCmp (StringPtr, L"OFFSET=", StrLen (L"OFFSET=")) == 0) { - // - // Back up the header of one - // - TmpPtr = StringPtr; - StringPtr += StrLen (L"OFFSET="); // // Get Offset diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c index 023733b8d5..6a92573275 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c @@ -1,7 +1,7 @@ /** @file IP4 option support functions. -Copyright (c) 2005 - 2006, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2011, 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 @@ -17,8 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. /** Validate the IP4 option format for both the packets we received - and will transmit. It will compute the ICMP error message fields - if the option is mal-formated. But this information isn't used. + and will transmit. @param[in] Option The first byte of the option @param[in] OptionLen The length of the whole option @@ -39,13 +38,6 @@ Ip4OptionIsValid ( UINT32 Cur; UINT32 Len; UINT32 Point; - volatile UINT8 IcmpType; - volatile UINT8 IcmpCode; - volatile UINT32 IcmpPoint; - - IcmpType = ICMP_PARAMETER_PROBLEM; - IcmpCode = 0; - IcmpPoint = 0; Cur = 0; @@ -69,12 +61,10 @@ Ip4OptionIsValid ( // SRR/RR options are formatted as |Type|Len|Point|Ip1|Ip2|... // if ((OptionLen - Cur < Len) || (Len < 3) || ((Len - 3) % 4 != 0)) { - IcmpPoint = Cur + 1; return FALSE; } if ((Point > Len + 1) || (Point % 4 != 0)) { - IcmpPoint = Cur + 2; return FALSE; } @@ -86,8 +76,6 @@ Ip4OptionIsValid ( if ((Option[Cur] != IP4_OPTION_RR) && ((Rcvd && (Point != Len + 1)) || (!Rcvd && (Point != 4)))) { - IcmpType = ICMP_DEST_UNREACHABLE; - IcmpCode = ICMP_SOURCEROUTE_FAILED; return FALSE; } @@ -98,7 +86,6 @@ Ip4OptionIsValid ( Len = Option[Cur + 1]; if ((OptionLen - Cur < Len) || (Len < 2)) { - IcmpPoint = Cur + 1; return FALSE; } diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c index b58a00a544..80e3a71edd 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -1005,7 +1005,6 @@ FindNextMenu ( CHAR16 YesResponse; CHAR16 NoResponse; EFI_INPUT_KEY Key; - EFI_STATUS Status; BROWSER_SETTING_SCOPE Scope; CurrentMenu = Selection->CurrentMenu; @@ -1032,7 +1031,7 @@ FindNextMenu ( // if ((gBrowserSettingScope == FormLevel && Selection->Form->NvUpdateRequired) || (gBrowserSettingScope == FormSetLevel && IsNvUpdateRequired(Selection->FormSet) && Scope == FormSetLevel)) { - Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); + gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); YesResponse = gYesResponse[0]; NoResponse = gNoResponse[0]; @@ -1068,12 +1067,12 @@ FindNextMenu ( // // If the user hits the YesResponse key // - Status = SubmitForm (Selection->FormSet, Selection->Form, Scope); + SubmitForm (Selection->FormSet, Selection->Form, Scope); } else { // // If the user hits the NoResponse key // - Status = DiscardForm (Selection->FormSet, Selection->Form, Scope); + DiscardForm (Selection->FormSet, Selection->Form, Scope); } } @@ -1101,7 +1100,7 @@ FindNextMenu ( // We are going to leave current FormSet, so check uncommited data in this FormSet // if (gBrowserSettingScope != SystemLevel && IsNvUpdateRequired(Selection->FormSet)) { - Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); + gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); YesResponse = gYesResponse[0]; NoResponse = gNoResponse[0]; @@ -1138,12 +1137,12 @@ FindNextMenu ( // // If the user hits the YesResponse key // - Status = SubmitForm (Selection->FormSet, Selection->Form, FormSetLevel); + SubmitForm (Selection->FormSet, Selection->Form, FormSetLevel); } else { // // If the user hits the NoResponse key // - Status = DiscardForm (Selection->FormSet, Selection->Form, FormSetLevel); + DiscardForm (Selection->FormSet, Selection->Form, FormSetLevel); } } diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index a1e6f81ecb..00462a270f 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -4128,7 +4128,6 @@ SaveReminder ( CHAR16 *ChangeReminderString; CHAR16 *SaveConfirmString; EFI_INPUT_KEY Key; - EFI_STATUS Status; DataSavedAction = BROWSER_NO_CHANGES; IsDataChanged = FALSE; @@ -4152,7 +4151,7 @@ SaveReminder ( // // If data is changed, prompt user // - Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); + gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); YesResponse = GetToken (STRING_TOKEN (ARE_YOU_SURE_YES), gHiiHandle); ASSERT (YesResponse != NULL); -- cgit v1.2.3