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/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 7 ------- .../Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c | 3 --- MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c | 4 ---- MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c | 20 +++++++++----------- MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 10 +++++----- MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 5 +---- MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c | 2 -- 7 files changed, 15 insertions(+), 36 deletions(-) (limited to 'MdeModulePkg/Bus') diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c index 6c8d4b2df6..0bc54abbf7 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c @@ -1389,7 +1389,6 @@ AhciReset ( IN UINT64 Timeout ) { - EFI_STATUS Status; UINT32 Delay; UINT32 Value; @@ -1397,8 +1396,6 @@ AhciReset ( AhciOrReg (PciIo, EFI_AHCI_GHC_OFFSET, EFI_AHCI_GHC_RESET); - Status = EFI_TIMEOUT; - Delay = (UINT32) (DivU64x32(Timeout, 1000) + 1); do { @@ -2137,8 +2134,6 @@ AhciModeInitialization ( UINT32 Capability; UINT8 MaxPortNumber; UINT32 PortImplementBitMap; - UINT8 MaxCommandSlotNumber; - BOOLEAN Support64Bit; EFI_AHCI_REGISTERS *AhciRegisters; @@ -2178,9 +2173,7 @@ AhciModeInitialization ( // // Get the number of command slots per port supported by this HBA. // - MaxCommandSlotNumber = (UINT8) (((Capability & 0x1F00) >> 8) + 1); MaxPortNumber = (UINT8) ((Capability & 0x1F) + 1); - Support64Bit = (BOOLEAN) (((Capability & EFI_AHCI_CAP_S64A) != 0) ? TRUE : FALSE); // // Get the bit map of those ports exposed by this HBA. diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c index 526590718a..72196a0040 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c @@ -658,13 +658,11 @@ AtaAtapiPassThruStart ( ATA_ATAPI_PASS_THRU_INSTANCE *Instance; EFI_PCI_IO_PROTOCOL *PciIo; UINT64 Supports; - BOOLEAN PciAttributesSaved; UINT64 OriginalPciAttributes; Status = EFI_SUCCESS; IdeControllerInit = NULL; Instance = NULL; - PciAttributesSaved = FALSE; OriginalPciAttributes = 0; DEBUG ((EFI_D_INFO, "==AtaAtapiPassThru Start== Controller = %x\n", Controller)); @@ -706,7 +704,6 @@ AtaAtapiPassThruStart ( if (EFI_ERROR (Status)) { goto ErrorExit; } - PciAttributesSaved = TRUE; Status = PciIo->Attributes ( PciIo, diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c index 17e4d7e13a..79310fcb49 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c @@ -1482,7 +1482,6 @@ AtaUdmaInOut ( EFI_PCI_IO_PROTOCOL_OPERATION PciIoOperation; UINT8 DeviceHead; - UINT8 AtaCommand; EFI_PCI_IO_PROTOCOL *PciIo; EFI_TPL OldTpl; @@ -1639,7 +1638,6 @@ AtaUdmaInOut ( // Start to enable the DMA operation // DeviceHead = AtaCommandBlock->AtaDeviceHead; - AtaCommand = AtaCommandBlock->AtaCommand; IdeWritePortB (PciIo, IdeRegisters->Head, (UINT8)(0xe0 | DeviceHead)); @@ -2797,7 +2795,6 @@ IdeModeInitialization ( IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance ) { - BOOLEAN EnumAll; EFI_STATUS Status; EFI_IDE_CONTROLLER_INIT_PROTOCOL *IdeInit; EFI_PCI_IO_PROTOCOL *PciIo; @@ -2808,7 +2805,6 @@ IdeModeInitialization ( IdeInit = Instance->IdeControllerInit; PciIo = Instance->PciIo; - EnumAll = IdeInit->EnumAll; Channel = IdeInit->ChannelCount; // diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c b/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c index d153aa39dc..8e9dad12d2 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c @@ -2,7 +2,7 @@ PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid which is used to enable recovery function from USB Drivers. -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 @@ -264,7 +264,6 @@ EhcUnlinkQhFromAsync ( ) { PEI_EHC_QH *Head; - EFI_STATUS Status; ASSERT (Ehc->ReclaimHead->NextQh == Qh); @@ -283,7 +282,7 @@ EhcUnlinkQhFromAsync ( // // Set and wait the door bell to synchronize with the hardware // - Status = EhcSetAndWaitDoorBell (Ehc, EHC_GENERIC_TIMEOUT); + EhcSetAndWaitDoorBell (Ehc, EHC_GENERIC_TIMEOUT); return; } @@ -804,8 +803,7 @@ EhcMoniteAsyncRequests ( BOOLEAN Finished; UINT8 *ProcBuf; PEI_URB *Urb; - EFI_STATUS Status; - UINTN PageNumber; + UINTN PageNumber; Ehc = (PEI_USB2_HC_DEV *) Context; @@ -826,7 +824,7 @@ EhcMoniteAsyncRequests ( // Flush any PCI posted write transactions from a PCI host // bridge to system memory. // - Status = EhcFlushAsyncIntMap (Ehc, Urb); + EhcFlushAsyncIntMap (Ehc, Urb); // // Allocate a buffer then copy the transferred data for user. @@ -838,11 +836,11 @@ EhcMoniteAsyncRequests ( if (Urb->Result == EFI_USB_NOERROR) { ASSERT (Urb->Completed <= Urb->DataLen); PageNumber = Urb->Completed/PAGESIZE +1; - Status = PeiServicesAllocatePages ( - EfiBootServicesCode, - PageNumber, - (EFI_PHYSICAL_ADDRESS *)ProcBuf - ); + PeiServicesAllocatePages ( + EfiBootServicesCode, + PageNumber, + (EFI_PHYSICAL_ADDRESS *)ProcBuf + ); if (ProcBuf == NULL) { EhcUpdateAsyncRequest (Urb); continue; diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c index bbde0ca0b7..5ccb78e55b 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c @@ -973,16 +973,16 @@ XhcControlTransfer ( // // For super speed hub, its bit10~12 presents the attached device speed. // - if ((*(UINT32 *)Data & XHC_PORTSC_PS) >> 10 == 0) { + if ((State & XHC_PORTSC_PS) >> 10 == 0) { PortStatus.PortStatus |= USB_PORT_STAT_SUPER_SPEED; } } else if (DeviceSpeed == EFI_USB_SPEED_HIGH) { // // For high speed hub, its bit9~10 presents the attached device speed. // - if (XHC_BIT_IS_SET (*(UINT32 *)Data, BIT9)) { + if (XHC_BIT_IS_SET (State, BIT9)) { PortStatus.PortStatus |= USB_PORT_STAT_LOW_SPEED; - } else if (XHC_BIT_IS_SET (*(UINT32 *)Data, BIT10)) { + } else if (XHC_BIT_IS_SET (State, BIT10)) { PortStatus.PortStatus |= USB_PORT_STAT_HIGH_SPEED; } } else { @@ -994,14 +994,14 @@ XhcControlTransfer ( // MapSize = sizeof (mUsbPortStateMap) / sizeof (USB_PORT_STATE_MAP); for (Index = 0; Index < MapSize; Index++) { - if (XHC_BIT_IS_SET (*(UINT32 *)Data, mUsbPortStateMap[Index].HwState)) { + if (XHC_BIT_IS_SET (State, mUsbPortStateMap[Index].HwState)) { PortStatus.PortStatus = (UINT16) (PortStatus.PortStatus | mUsbPortStateMap[Index].UefiState); } } MapSize = sizeof (mUsbPortChangeMap) / sizeof (USB_PORT_STATE_MAP); for (Index = 0; Index < MapSize; Index++) { - if (XHC_BIT_IS_SET (*(UINT32 *)Data, mUsbPortChangeMap[Index].HwState)) { + if (XHC_BIT_IS_SET (State, mUsbPortChangeMap[Index].HwState)) { PortStatus.PortChangeStatus = (UINT16) (PortStatus.PortChangeStatus | mUsbPortChangeMap[Index].UefiState); } } diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c index 6745d2f81a..49cc2619eb 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c @@ -181,6 +181,7 @@ XhcCreateUrb ( Urb->Context = Context; Status = XhcCreateTransferTrb (Xhc, Urb); + ASSERT_EFI_ERROR (Status); return Urb; } @@ -740,13 +741,11 @@ XhcFreeEventRing ( EVENT_RING_SEG_TABLE_ENTRY *TablePtr; VOID *RingBuf; EVENT_RING_SEG_TABLE_ENTRY *EventRingPtr; - UINTN InterrupterTarget; if(EventRing->EventRingSeg0 == NULL) { return EFI_SUCCESS; } - InterrupterTarget = EventRing->EventInterrupter; // // Get the Event Ring Segment Table base address // @@ -1048,12 +1047,10 @@ XhciDelAsyncIntTransfer ( LIST_ENTRY *Next; URB *Urb; EFI_USB_DATA_DIRECTION Direction; - BOOLEAN Found; Direction = ((EpNum & 0x80) != 0) ? EfiUsbDataIn : EfiUsbDataOut; EpNum &= 0x0F; - Found = FALSE; Urb = NULL; EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Xhc->AsyncIntTransfers) { diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c index e830517dd9..e3ff281643 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c @@ -534,10 +534,8 @@ UsbBootGetParams ( { EFI_BLOCK_IO_MEDIA *Media; EFI_STATUS Status; - UINT8 CmdSet; Media = &(UsbMass->BlockIoMedia); - CmdSet = ((EFI_USB_INTERFACE_DESCRIPTOR *) (UsbMass->Context))->InterfaceSubClass; Status = UsbBootInquiry (UsbMass); if (EFI_ERROR (Status)) { -- cgit v1.2.3