diff options
author | xli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-25 06:15:58 +0000 |
---|---|---|
committer | xli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-25 06:15:58 +0000 |
commit | 1cc8ee7861a59532700a6fd1255689576eda0f52 (patch) | |
tree | 7708d058115302ba08d7879965e8864467958e93 /EdkModulePkg/Bus | |
parent | 582510249f2fb1334e507b99421b9485f6b89159 (diff) | |
download | edk2-platforms-1cc8ee7861a59532700a6fd1255689576eda0f52.tar.xz |
Partially make EdkModulePkg pass intel IPF compiler with /W4 /WX switched on.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2313 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Bus')
29 files changed, 98 insertions, 136 deletions
diff --git a/EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.c b/EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.c index f11158bb9c..28be3f7026 100644 --- a/EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.c +++ b/EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.c @@ -45,7 +45,7 @@ static IDE_BASE_REGISTERS gAtapiIoPortRegisters[2] = { { 0x170, { 0x171 }, 0x172, 0x173, 0x174, 0x175, 0x176, { 0x177 }, { 0x376 }, 0x377, 0 }
};
-static SCSI_COMMAND_SET gEndTable = { 0xff, 0xff };
+static SCSI_COMMAND_SET gEndTable = { 0xff, (DATA_DIRECTION) 0xff };
///
/// This table contains all the supported ATAPI commands.
@@ -83,7 +83,7 @@ static SCSI_COMMAND_SET gSupportedATAPICommands[] = { { OP_WRITE_10, DataOut },
{ OP_WRITE_12, DataOut },
{ OP_WRITE_AND_VERIFY, DataOut },
- { 0xff, 0xff }
+ { 0xff, (DATA_DIRECTION) 0xff }
};
static CHAR16 *gControllerNameString = (CHAR16 *) L"ATAPI Controller";
@@ -595,15 +595,9 @@ AtapiScsiPassThruBuildDevicePath ( IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
)
{
- ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate;
EFI_DEV_PATH *Node;
//
- // Retrieve Device Private Data Structure.
- //
- AtapiScsiPrivate = ATAPI_SCSI_PASS_THRU_DEV_FROM_THIS (This);
-
- //
// Validate parameters passed in.
//
@@ -995,7 +989,7 @@ SubmitBlockingIoCommand ( PacketCommand,
Packet->DataBuffer,
&(Packet->TransferLength),
- Packet->DataDirection,
+ (DATA_DIRECTION) Packet->DataDirection,
TimeoutInMicroSeconds
);
if (!EFI_ERROR (PacketCommandStatus) || (Packet->SenseData == NULL)) {
@@ -1319,11 +1313,9 @@ AtapiPassThruPioReadWriteData ( //
// get current data transfer size from Cylinder Registers.
//
- WordCount =
- (
- (ReadPortB (AtapiScsiPrivate->PciIo, AtapiScsiPrivate->IoPort->CylinderMsb) << 8) |
- ReadPortB (AtapiScsiPrivate->PciIo, AtapiScsiPrivate->IoPort->CylinderLsb)
- ) & 0xffff;
+ WordCount = ReadPortB (AtapiScsiPrivate->PciIo, AtapiScsiPrivate->IoPort->CylinderMsb) << 8;
+ WordCount = WordCount | ReadPortB (AtapiScsiPrivate->PciIo, AtapiScsiPrivate->IoPort->CylinderLsb);
+ WordCount = WordCount & 0xffff;
WordCount /= 2;
//
diff --git a/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430UgaDraw.c b/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430UgaDraw.c index 60e0582cf0..be05f8766f 100644 --- a/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430UgaDraw.c +++ b/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430UgaDraw.c @@ -176,6 +176,7 @@ inw ( @retval EFI_SUCCESS TODO: Add description for return value
**/
+STATIC
EFI_STATUS
EFIAPI
CirrusLogic5430UgaDrawGetMode (
@@ -223,6 +224,7 @@ CirrusLogic5430UgaDrawGetMode ( @retval EFI_NOT_FOUND TODO: Add description for return value
**/
+STATIC
EFI_STATUS
EFIAPI
CirrusLogic5430UgaDrawSetMode (
@@ -301,6 +303,7 @@ CirrusLogic5430UgaDrawSetMode ( @retval EFI_SUCCESS TODO: Add description for return value
**/
+STATIC
EFI_STATUS
EFIAPI
CirrusLogic5430UgaDrawBlt (
diff --git a/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/ComponentName.c b/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/ComponentName.c index 933899fa12..38d86a556c 100644 --- a/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/ComponentName.c +++ b/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/ComponentName.c @@ -142,7 +142,6 @@ CirrusLogic5430ComponentNameGetControllerName ( {
EFI_UGA_DRAW_PROTOCOL *UgaDraw;
EFI_STATUS Status;
- CIRRUS_LOGIC_5430_PRIVATE_DATA *Private;
EFI_PCI_IO_PROTOCOL *PciIoProtocol;
//
@@ -196,8 +195,6 @@ CirrusLogic5430ComponentNameGetControllerName ( //
// Get the Cirrus Logic 5430's Device structure
//
- Private = CIRRUS_LOGIC_5430_PRIVATE_DATA_FROM_UGA_DRAW_THIS (UgaDraw);
-
return LookupUnicodeString (
Language,
gCirrusLogic5430ComponentName.SupportedLanguages,
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c index 2d6dc838a4..baea1f608d 100644 --- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c +++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c @@ -1281,9 +1281,9 @@ EhciGetRootHubPortStatus ( // Not Low Speed Device Attached
//
if ((PORTSC_CCS & PortStatusControlReg) && (PORTSC_CSC & PortStatusControlReg)) {
- HcDev->DeviceSpeed[PortNumber] = IsHighSpeedDevice (This, PortNumber) ? USB_PORT_STAT_HIGH_SPEED : 0;
+ HcDev->DeviceSpeed[PortNumber] = (UINT16) (IsHighSpeedDevice (This, PortNumber) ? USB_PORT_STAT_HIGH_SPEED : 0);
}
- PortStatus->PortStatus |= HcDev->DeviceSpeed[PortNumber];
+ PortStatus->PortStatus = (UINT16) (PortStatus->PortStatus | HcDev->DeviceSpeed[PortNumber]);
}
//
// Fill Port Status Change bits
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c index 0a992fe8ad..aba27cb82c 100644 --- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c +++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c @@ -380,7 +380,7 @@ Returns: // reset associated bits in bit arry
//
for (Index = StartBytePos, Index2 = StartBitPos, Count = 0; Count < (RealAllocSize / 32); Count++) {
- TempHeaderPtr->BitArrayPtr[Index] ^= (UINT8) (bit (Index2));
+ TempHeaderPtr->BitArrayPtr[Index] = (UINT8) (TempHeaderPtr->BitArrayPtr[Index] ^ (bit (Index2)));
Index2++;
if (Index2 == 8) {
Index += 1;
@@ -595,7 +595,7 @@ Returns: //
for (TempBytePos = FoundBytePos, Index = FoundBitPos, Count = 0; Count < NumberOfMemoryUnit; Count++) {
- MemoryHeader->BitArrayPtr[TempBytePos] |= bit (Index);
+ MemoryHeader->BitArrayPtr[TempBytePos] = (UINT8) (MemoryHeader->BitArrayPtr[TempBytePos] | (bit (Index)));
Index++;
if (Index == 8) {
TempBytePos += 1;
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciReg.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciReg.c index 5767bbc024..d5271c25b2 100644 --- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciReg.c +++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciReg.c @@ -1136,7 +1136,7 @@ Returns: &PortStatusControlReg
);
- return ((PortStatusControlReg & PORTSC_PED) ? TRUE : FALSE);
+ return ((BOOLEAN) ((PortStatusControlReg & PORTSC_PED) ? TRUE : FALSE));
}
BOOLEAN
@@ -1347,7 +1347,7 @@ Returns: //
gBS->Stall (EHCI_CLEAR_PORT_RESET_RECOVERY_TIME);
- return (IsEhcPortEnabled (HcDev, PortNum) ? TRUE : FALSE);
+ return ((BOOLEAN) (IsEhcPortEnabled (HcDev, PortNum) ? TRUE : FALSE));
}
EFI_STATUS
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c index 9f1a15d093..48432c0b98 100644 --- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c +++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c @@ -2547,7 +2547,7 @@ Returns: MatchPtr = NULL;
QhHwPtr = NULL;
- EndPointNum = EndPointAddress & 0x0f;
+ EndPointNum = (UINT8) (EndPointAddress & 0x0f);
AsyncRequestPtr = HcDev->AsyncRequestList;
//
@@ -2916,13 +2916,11 @@ Returns: EFI_STATUS Status;
UINTN ErrQtdPos;
UINTN Delay;
- UINTN RequireLen;
BOOLEAN Finished;
Status = EFI_SUCCESS;
ErrQtdPos = 0;
*TransferResult = EFI_USB_NOERROR;
- RequireLen = *ActualLen;
*ActualLen = 0;
Finished = FALSE;
diff --git a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/DriverConfiguration.c b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/DriverConfiguration.c index 75794f8125..6a05562a17 100644 --- a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/DriverConfiguration.c +++ b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/DriverConfiguration.c @@ -64,6 +64,7 @@ EFI_DRIVER_CONFIGURATION_PROTOCOL gIDEBusDriverConfiguration = { @retval EFI_NOT_FOUND TODO: Add description for return value
**/
+STATIC
EFI_STATUS
GetResponse (
VOID
@@ -190,7 +191,7 @@ IDEBusDriverConfigurationSetOptions ( }
if (!EFI_ERROR (Status)) {
- NewValue |= (UINT8) (1 << Index);
+ NewValue = (UINT8) (NewValue | (1 << Index));
}
}
diff --git a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ata.c b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ata.c index 3273380da0..7ea54b9a4f 100644 --- a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ata.c +++ b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ata.c @@ -2073,7 +2073,7 @@ AtaCommandIssue ( Lba1 = (UINT8) RShiftU64 (LbaAddress, 8);
Lba2 = (UINT8) RShiftU64 (LbaAddress, 16);
Lba3 = (UINT8) RShiftU64 (LbaAddress, 24);
- Device |= Lba3;
+ Device = (UINT8) (Device | Lba3);
//
// Pass parameter into device register block
diff --git a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/atapi.c b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/atapi.c index a54acf6994..93f7081516 100644 --- a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/atapi.c +++ b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/atapi.c @@ -714,11 +714,6 @@ PioReadWriteData ( UINT16 *PtrBuffer;
//
- // containing status byte read from Status Register.
- //
- UINT8 StatusRegister;
-
- //
// No data transfer is premitted.
//
if (ByteCount == 0) {
@@ -750,16 +745,14 @@ PioReadWriteData ( //
// read Status Register will clear interrupt
//
- StatusRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg.Status);
+ IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg.Status);
//
// get current data transfer size from Cylinder Registers.
//
- WordCount =
- (
- (IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->CylinderMsb) << 8) |
- IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->CylinderLsb)
- ) & 0xffff;
+ WordCount = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->CylinderMsb) << 8;
+ WordCount = WordCount | IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->CylinderLsb);
+ WordCount = WordCount & 0xffff;
WordCount /= 2;
WordCount = EFI_MIN (WordCount, (RequiredWordCount - ActualWordCount));
diff --git a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ide.c b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ide.c index 0b28c57a03..14cdb251bb 100644 --- a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ide.c +++ b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ide.c @@ -236,6 +236,7 @@ IDEWritePortWMultiple ( TODO: add return values
**/
+STATIC
BOOLEAN
BadIdeDeviceCheck (
IN IDE_BLK_IO_DEV *IdeDev
diff --git a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c index c0cec601b8..fd04b67216 100644 --- a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c +++ b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c @@ -189,7 +189,6 @@ IDEBusDriverBindingStart ( EFI_IDE_CONTROLLER_INIT_PROTOCOL *IdeInit;
BOOLEAN EnumAll;
BOOLEAN ChannelEnabled;
- UINT8 ChannelCount;
UINT8 MaxDevices;
EFI_IDENTIFY_DATA IdentifyData;
EFI_ATA_COLLECTIVE_MODE *SupportedModes;
@@ -239,10 +238,9 @@ IDEBusDriverBindingStart ( }
//
- // Save Enumall and ChannelCount. Step7.2
+ // Save Enumall. Step7.2
//
EnumAll = IdeInit->EnumAll;
- ChannelCount = IdeInit->ChannelCount;
//
// Consume PCI I/O protocol. Note that the OpenProtocol with _GET_PROTOCOL
@@ -453,8 +451,8 @@ IDEBusDriverBindingStart ( ZeroMem (IdeBlkIoDevicePtr, sizeof (IDE_BLK_IO_DEV));
IdeBlkIoDevicePtr->Signature = IDE_BLK_IO_DEV_SIGNATURE;
- IdeBlkIoDevicePtr->Channel = IdeChannel;
- IdeBlkIoDevicePtr->Device = IdeDevice;
+ IdeBlkIoDevicePtr->Channel = (EFI_IDE_CHANNEL) IdeChannel;
+ IdeBlkIoDevicePtr->Device = (EFI_IDE_DEVICE) IdeDevice;
//
// initialize Block IO interface's Media pointer
@@ -666,7 +664,7 @@ IDEBusDriverBindingStart ( //
// Record PIO mode used in private data
//
- IdeBlkIoDevicePtr->PioMode = SupportedModes->PioMode.Mode;
+ IdeBlkIoDevicePtr->PioMode = (ATA_PIO_MODE) SupportedModes->PioMode.Mode;
//
// Set IDE controller Timing Blocks in the PCI Configuration Space
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciCommand.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciCommand.c index f07c73fd3f..6b472448d9 100644 --- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciCommand.c +++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciCommand.c @@ -71,9 +71,9 @@ Returns: }
if (Operation == EFI_ENABLE_REGISTER) {
- OldCommand |= Command;
+ OldCommand = (UINT16) (OldCommand | Command);
} else if (Operation == EFI_DISABLE_REGISTER) {
- OldCommand &= ~(Command);
+ OldCommand = (UINT16) (OldCommand & ~(Command));
} else {
OldCommand = Command;
}
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciEnumeratorSupport.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciEnumeratorSupport.c index ce605cc813..3b796a6b42 100644 --- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciEnumeratorSupport.c +++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciEnumeratorSupport.c @@ -969,6 +969,7 @@ Returns: }
+STATIC
EFI_STATUS
ProcessOptionRomLight (
IN PCI_IO_DEVICE *PciIoDevice
@@ -1432,7 +1433,6 @@ Returns: // TODO: BarIndex - add argument and description to function comment
{
UINT32 Value;
- UINT64 BarValue64;
UINT32 OriginalValue;
UINT32 Mask;
UINT32 Data;
@@ -1441,7 +1441,6 @@ Returns: OriginalValue = 0;
Value = 0;
- BarValue64 = 0;
Status = BarExisted (
PciIoDevice,
@@ -1491,7 +1490,7 @@ Returns: // Need to treat it as no-bar
//
if (PciIoDevice->PciBar[BarIndex].Length == 0) {
- PciIoDevice->PciBar[BarIndex].BarType = 0;
+ PciIoDevice->PciBar[BarIndex].BarType = (PCI_BAR_TYPE) 0;
}
PciIoDevice->PciBar[BarIndex].Prefetchable = FALSE;
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciIo.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciIo.c index 040c57095d..a636d4ff2c 100644 --- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciIo.c +++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciIo.c @@ -184,7 +184,7 @@ Returns: Count = 1;
}
- Width &= 0x03;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & 0x03);
if ((*Offset + Count * (UINTN)(1 << Width)) - 1 >= PciIoDevice->PciBar[BarIndex].Length) {
return EFI_INVALID_PARAMETER;
@@ -233,7 +233,7 @@ Returns: //
// If Width is EfiPciIoWidthFillUintX then convert to EfiPciIoWidthUintX
//
- Width &= 0x03;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & 0x03);
if (PciIoDevice->IsPciExp) {
if ((*Offset + Count * (UINTN)(1 << Width)) - 1 >= PCI_EXP_MAX_CONFIG_OFFSET) {
@@ -876,7 +876,7 @@ Returns: }
if (PciIoDevice->Attributes & EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE) {
- Operation = Operation + EfiPciOperationBusMasterRead64;
+ Operation = (EFI_PCI_IO_PROTOCOL_OPERATION) (Operation + EfiPciOperationBusMasterRead64);
}
Status = PciIoDevice->PciRootBridgeIo->Map (
@@ -1966,10 +1966,15 @@ Returns: // TODO: PciDevice1 - add argument and description to function comment
// TODO: PciDevice2 - add argument and description to function comment
{
+ BOOLEAN Existed1;
+ BOOLEAN Existed2;
if (PciDevice1->Parent == PciDevice2->Parent) {
return TRUE;
}
- return (PciDeviceExisted (PciDevice1->Parent, PciDevice2)|| PciDeviceExisted (PciDevice2->Parent, PciDevice1));
+ Existed1 = PciDeviceExisted (PciDevice1->Parent, PciDevice2);
+ Existed2 = PciDeviceExisted (PciDevice2->Parent, PciDevice1);
+
+ return (BOOLEAN) (Existed1 || Existed2);
}
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c index a4d3577d35..c9c46b3adf 100644 --- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c +++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c @@ -94,6 +94,7 @@ Returns: EFI_NATIVE_INTERFACE,
NULL
);
+ ASSERT_EFI_ERROR (Status);
}
}
@@ -1446,7 +1447,7 @@ Returns: SecondBus = 0;
Register = 0;
State = 0;
- Attributes = 0;
+ Attributes = (EFI_HPC_PADDING_ATTRIBUTES) 0;
BusRange = 0;
ResetAllPpbBusReg (Bridge, StartBusNumber);
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciOptionRomSupport.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciOptionRomSupport.c index 449d0dc443..2ced4acb0b 100644 --- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciOptionRomSupport.c +++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciOptionRomSupport.c @@ -151,7 +151,6 @@ Returns: UINT16 OffsetPcir;
UINT32 RomBarOffset;
UINT32 RomBar;
- UINT64 Temp;
EFI_STATUS retStatus;
BOOLEAN FirstCheck;
UINT8 *Image;
@@ -167,7 +166,6 @@ Returns: Indicator = 0;
RomImageSize = 0;
RomInMemory = NULL;
- Temp = 0;
CodeType = 0xFF;
//
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c index 58dbc9fd4c..482ddc9274 100644 --- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c +++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c @@ -647,10 +647,8 @@ Returns: // TODO: ResType - add argument and description to function comment
// TODO: ResUsage - add argument and description to function comment
{
- EFI_STATUS Status;
PCI_RESOURCE_NODE *Node;
- Status = 0;
Node = NULL;
Node = AllocatePool (sizeof (PCI_RESOURCE_NODE));
@@ -704,7 +702,6 @@ Returns: // TODO: EFI_SUCCESS - add return value to function comment
{
PCI_IO_DEVICE *Temp;
- EFI_STATUS Status;
PCI_RESOURCE_NODE *IoBridge;
PCI_RESOURCE_NODE *Mem32Bridge;
PCI_RESOURCE_NODE *PMem32Bridge;
@@ -789,14 +786,14 @@ Returns: //
// Recursively create resouce map on this bridge
//
- Status = CreateResourceMap (
- Temp,
- IoBridge,
- Mem32Bridge,
- PMem32Bridge,
- Mem64Bridge,
- PMem64Bridge
- );
+ CreateResourceMap (
+ Temp,
+ IoBridge,
+ Mem32Bridge,
+ PMem32Bridge,
+ Mem64Bridge,
+ PMem64Bridge
+ );
if (ResourceRequestExisted (IoBridge)) {
InsertResourceNode (
@@ -895,14 +892,14 @@ Returns: //
// To do some platform specific resource padding ...
//
- Status = ResourcePaddingPolicy (
- Bridge,
- IoNode,
- Mem32Node,
- PMem32Node,
- Mem64Node,
- PMem64Node
- );
+ ResourcePaddingPolicy (
+ Bridge,
+ IoNode,
+ Mem32Node,
+ PMem32Node,
+ Mem64Node,
+ PMem64Node
+ );
//
// Degrade resource if necessary
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciRomTable.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciRomTable.c index a1e16a0eea..8f5a450d75 100644 --- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciRomTable.c +++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciRomTable.c @@ -101,6 +101,7 @@ Returns: mNumberOfPciRomImages++;
}
+STATIC
VOID
HexToString (
CHAR16 *String,
@@ -134,6 +135,8 @@ Returns: }
}
}
+
+STATIC
EFI_STATUS
PciRomLoadEfiDriversFromRomImage (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
@@ -307,6 +310,7 @@ Returns: return retStatus;
}
+STATIC
EFI_STATUS
PciRomLoadEfiDriversFromOptionRomTable (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
diff --git a/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhchlp.c b/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhchlp.c index 74ddc6bb12..8dbc0d9a33 100644 --- a/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhchlp.c +++ b/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhchlp.c @@ -21,6 +21,7 @@ Revision History #include "uhci.h"
+STATIC
EFI_STATUS
USBReadPortW (
IN EFI_PCI_IO_PROTOCOL *PciIo,
@@ -58,6 +59,7 @@ Returns: );
}
+STATIC
EFI_STATUS
USBReadPortDW (
IN EFI_PCI_IO_PROTOCOL *PciIo,
@@ -95,6 +97,7 @@ Returns: );
}
+STATIC
EFI_STATUS
USBWritePortW (
IN EFI_PCI_IO_PROTOCOL *PciIo,
@@ -132,6 +135,7 @@ Returns: );
}
+STATIC
EFI_STATUS
USBWritePortDW (
IN EFI_PCI_IO_PROTOCOL *PciIo,
@@ -654,13 +658,12 @@ Returns: --*/
{
UINT16 CommandContent;
- EFI_STATUS Status;
- Status = ReadUHCCommandReg (
- HcDev->PciIo,
- (UINT32) (USBCMD),
- &CommandContent
- );
+ ReadUHCCommandReg (
+ HcDev->PciIo,
+ (UINT32) (USBCMD),
+ &CommandContent
+ );
if ((CommandContent & USBCMD_MAXP) != USBCMD_MAXP) {
CommandContent |= USBCMD_MAXP;
@@ -835,6 +838,7 @@ Returns: //
// functions for QH
//
+STATIC
EFI_STATUS
AllocateQHStruct (
IN USB_HC_DEV *HcDev,
@@ -1196,6 +1200,7 @@ Returns: return (BOOLEAN) (!(PtrQH->QH.QHVerticalTerminate));
}
+STATIC
BOOLEAN
GetQHHorizontalValidorInvalid (
IN QH_STRUCT *PtrQH
@@ -1769,6 +1774,7 @@ Returns: return (VOID *) ((UINTN) (ptrTDStruct->TDData.TDLinkPtr << 4));
}
+STATIC
BOOLEAN
IsTDLinkPtrQHOrTD (
IN TD_STRUCT *ptrTDStruct
@@ -2325,6 +2331,7 @@ SetCurFrameListQHorTD ( pCurEntry->FrameListPtrQSelect = (IsQH ? 1 : 0);
}
+STATIC
BOOLEAN
IsCurFrameListQHorTD (
IN FRAMELIST_ENTRY *pCurEntry
@@ -3854,7 +3861,7 @@ Returns: //
for (Index = StartBytePos, Index2 = StartBitPos, Count = 0; Count < (RealAllocSize / 32); Count++) {
- TempHeaderPtr->BitArrayPtr[Index] ^= (UINT8) (bit (Index2));
+ TempHeaderPtr->BitArrayPtr[Index] = (UINT8) (TempHeaderPtr->BitArrayPtr[Index] ^ bit (Index2));
Index2++;
if (Index2 == 8) {
Index += 1;
@@ -4067,7 +4074,7 @@ Returns: for (TempBytePos = FoundBytePos, Index = FoundBitPos,Count = 0;
Count < NumberOfMemoryUnit; Count ++) {
- MemoryHeader->BitArrayPtr[TempBytePos] |= bit (Index);
+ MemoryHeader->BitArrayPtr[TempBytePos] = (UINT8) (MemoryHeader->BitArrayPtr[TempBytePos] | bit (Index));
Index++;
if (Index == 8) {
TempBytePos += 1;
diff --git a/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhci.c b/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhci.c index 96c5be48ba..3d81d2c5c3 100644 --- a/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhci.c +++ b/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhci.c @@ -759,7 +759,7 @@ UHCIDriverBindingStart ( return EFI_SUCCESS;
}
-
+STATIC
EFI_STATUS
UnInstallUHCInterface (
IN EFI_HANDLE Controller,
@@ -3845,7 +3845,7 @@ UHCI2ControlTransfer ( --*/
{
USB_HC_DEV *HcDev;
- BOOLEAN IsSlowDevice = (EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE;
+ BOOLEAN IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);
HcDev = USB2_HC_DEV_FROM_THIS (This);
@@ -4056,7 +4056,7 @@ UHCI2AsyncInterruptTransfer ( --*/
{
USB_HC_DEV *HcDev;
- BOOLEAN IsSlowDevice = (EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE;
+ BOOLEAN IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);
HcDev = USB2_HC_DEV_FROM_THIS (This);
return UHCIAsyncInterruptTransfer(
@@ -4155,7 +4155,7 @@ UHCI2SyncInterruptTransfer ( if(DeviceSpeed==EFI_USB_SPEED_HIGH)
return EFI_INVALID_PARAMETER;
- IsSlowDevice = (EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE;
+ IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);
HcDev = USB2_HC_DEV_FROM_THIS (This);
return UHCISyncInterruptTransfer(
@@ -4437,11 +4437,9 @@ MonitorInterruptTrans ( UINTN DataLen;
UINTN ActualLen;
UINTN ErrTDPos;
- UINT32 StatusAddr;
LIST_ENTRY *NextLink;
HcDev = (USB_HC_DEV *) Context;
- StatusAddr = (UINT32) (USBSTS);
//
// interrupt transfer list is empty, means that no interrupt transfer
diff --git a/EdkModulePkg/Bus/Scsi/ScsiBus/Dxe/ScsiBus.c b/EdkModulePkg/Bus/Scsi/ScsiBus/Dxe/ScsiBus.c index 2ef31fb38c..b7b59615fd 100644 --- a/EdkModulePkg/Bus/Scsi/ScsiBus/Dxe/ScsiBus.c +++ b/EdkModulePkg/Bus/Scsi/ScsiBus/Dxe/ScsiBus.c @@ -362,6 +362,7 @@ ScsiGetDeviceType ( return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
EFIAPI
ScsiGetDeviceLocation (
diff --git a/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.c b/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.c index 4be2c38817..10134e864e 100644 --- a/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.c +++ b/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.c @@ -1614,11 +1614,9 @@ Returns: UINT8 MaxRetry;
BOOLEAN NeedRetry;
EFI_SCSI_SENSE_DATA *SenseData;
- UINT8 SenseDataLength;
UINTN NumberOfSenseKeys;
SenseData = NULL;
- SenseDataLength = 0;
NumberOfSenseKeys = 0;
Status = EFI_SUCCESS;
@@ -1728,11 +1726,9 @@ Returns: UINT8 MaxRetry;
BOOLEAN NeedRetry;
EFI_SCSI_SENSE_DATA *SenseData;
- UINT8 SenseDataLength;
UINTN NumberOfSenseKeys;
SenseData = NULL;
- SenseDataLength = 0;
NumberOfSenseKeys = 0;
Status = EFI_SUCCESS;
diff --git a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c index d9b094d114..91a447de66 100644 --- a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c +++ b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c @@ -457,7 +457,6 @@ Cbi0DriverBindingStop ( EFI_STATUS Status;
EFI_USB_ATAPI_PROTOCOL *Cbi0AtapiProtocol;
USB_CBI_DEVICE *UsbCbiDev;
- EFI_USB_IO_PROTOCOL *UsbIo;
//
// Get our context back.
@@ -476,8 +475,6 @@ Cbi0DriverBindingStop ( UsbCbiDev = USB_CBI_DEVICE_FROM_THIS (Cbi0AtapiProtocol);
- UsbIo = UsbCbiDev->UsbIo;
-
Cbi0ReportStatusCode (
UsbCbiDev->DevicePath,
EFI_PROGRESS_CODE,
@@ -850,11 +847,9 @@ Cbi0MassStorageReset ( --*/
{
EFI_STATUS Status;
- EFI_USB_IO_PROTOCOL *UsbIo;
USB_CBI_DEVICE *UsbCbiDev;
UsbCbiDev = USB_CBI_DEVICE_FROM_THIS (This);
- UsbIo = UsbCbiDev->UsbIo;
if (ExtendedVerification) {
//
diff --git a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c index d778497096..008627b9dd 100644 --- a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c +++ b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c @@ -400,7 +400,6 @@ CBI1DriverBindingStop ( EFI_STATUS Status;
EFI_USB_ATAPI_PROTOCOL *CBI1AtapiProtocol;
USB_CBI_DEVICE *UsbCbiDev;
- EFI_USB_IO_PROTOCOL *UsbIo;
//
// Get our context back.
@@ -419,8 +418,6 @@ CBI1DriverBindingStop ( UsbCbiDev = USB_CBI_DEVICE_FROM_THIS (CBI1AtapiProtocol);
- UsbIo = UsbCbiDev->UsbIo;
-
Cbi1ReportStatusCode (
UsbCbiDev->DevicePath,
EFI_PROGRESS_CODE,
@@ -644,7 +641,6 @@ CBI1MassStorageReset ( --*/
{
UINT8 ResetCommand[12];
- EFI_STATUS Status;
EFI_USB_IO_PROTOCOL *UsbIo;
USB_CBI_DEVICE *UsbCbiDev;
UINT8 EndpointAddr;
@@ -669,12 +665,12 @@ CBI1MassStorageReset ( ResetCommand[0] = 0x1d;
ResetCommand[1] = 0x04;
- Status = CBI1CommandPhase (
- UsbCbiDev,
- ResetCommand,
- 12,
- &Result
- );
+ CBI1CommandPhase (
+ UsbCbiDev,
+ ResetCommand,
+ 12,
+ &Result
+ );
//
// clear bulk in endpoint stall feature
diff --git a/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c b/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c index ec496a6e39..1b8c96166c 100644 --- a/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c +++ b/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c @@ -467,7 +467,6 @@ USBKeyboardDriverBindingStop ( EFI_STATUS Status;
EFI_SIMPLE_TEXT_IN_PROTOCOL *SimpleInput;
USB_KB_DEV *UsbKeyboardDevice;
- EFI_USB_IO_PROTOCOL *UsbIo;
Status = gBS->OpenProtocol (
Controller,
@@ -493,7 +492,6 @@ USBKeyboardDriverBindingStop ( Controller
);
- UsbIo = UsbKeyboardDevice->UsbIo;
//
// Uninstall the Asyn Interrupt Transfer from this device
// will disable the key data input from this device
@@ -574,12 +572,9 @@ USBKeyboardReset ( {
EFI_STATUS Status;
USB_KB_DEV *UsbKeyboardDevice;
- EFI_USB_IO_PROTOCOL *UsbIo;
UsbKeyboardDevice = USB_KB_DEV_FROM_THIS (This);
- UsbIo = UsbKeyboardDevice->UsbIo;
-
KbdReportStatusCode (
UsbKeyboardDevice->DevicePath,
EFI_PROGRESS_CODE,
diff --git a/EdkModulePkg/Bus/Usb/UsbKb/Dxe/keyboard.c b/EdkModulePkg/Bus/Usb/UsbKb/Dxe/keyboard.c index b6b97c3b48..79eded33c3 100644 --- a/EdkModulePkg/Bus/Usb/UsbKb/Dxe/keyboard.c +++ b/EdkModulePkg/Bus/Usb/UsbKb/Dxe/keyboard.c @@ -210,9 +210,6 @@ InitUSBKeyboard ( UINT8 Duration;
EFI_STATUS Status;
UINT32 TransferResult;
- EFI_USB_IO_PROTOCOL *UsbIo;
-
- UsbIo = UsbKeyboardDevice->UsbIo;
KbdReportStatusCode (
UsbKeyboardDevice->DevicePath,
@@ -360,19 +357,16 @@ KeyboardHandler ( UINT8 Index;
UINT8 Index2;
BOOLEAN Down;
- EFI_STATUS Status;
BOOLEAN KeyRelease;
BOOLEAN KeyPress;
UINT8 SavedTail;
USB_KEY UsbKey;
UINT8 NewRepeatKey;
UINT32 UsbStatus;
- UINT8 *DataPtr;
ASSERT (Context);
NewRepeatKey = 0;
- DataPtr = (UINT8 *) Data;
UsbKeyboardDevice = (USB_KB_DEV *) Context;
UsbIo = UsbKeyboardDevice->UsbIo;
@@ -412,15 +406,15 @@ KeyboardHandler ( // Delete & Submit this interrupt again
//
- Status = UsbIo->UsbAsyncInterruptTransfer (
- UsbIo,
- UsbKeyboardDevice->IntEndpointDescriptor.EndpointAddress,
- FALSE,
- 0,
- 0,
- NULL,
- NULL
- );
+ UsbIo->UsbAsyncInterruptTransfer (
+ UsbIo,
+ UsbKeyboardDevice->IntEndpointDescriptor.EndpointAddress,
+ FALSE,
+ 0,
+ 0,
+ NULL,
+ NULL
+ );
gBS->SetTimer (
UsbKeyboardDevice->DelayedRecoveryEvent,
diff --git a/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.c b/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.c index 0d57f7642d..b86c06a514 100644 --- a/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.c +++ b/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.c @@ -443,12 +443,10 @@ USBFloppyReadBlocks ( UINTN NumberOfBlocks;
BOOLEAN MediaChange;
EFI_TPL OldTpl;
- UINT32 Retry;
OldTpl = gBS->RaiseTPL (EFI_TPL_NOTIFY);
Status = EFI_SUCCESS;
MediaChange = FALSE;
- Retry = 0;
UsbFloppyDevice = USB_FLOPPY_DEV_FROM_THIS (This);
@@ -594,12 +592,10 @@ USBFloppyWriteBlocks ( UINTN NumberOfBlocks;
BOOLEAN MediaChange;
EFI_TPL OldTpl;
- UINT32 Retry;
OldTpl = gBS->RaiseTPL (EFI_TPL_NOTIFY);
Status = EFI_SUCCESS;
MediaChange = FALSE;
- Retry = 0;
UsbFloppyDevice = USB_FLOPPY_DEV_FROM_THIS (This);
diff --git a/EdkModulePkg/Bus/Usb/UsbMouse/Dxe/usbmouse.c b/EdkModulePkg/Bus/Usb/UsbMouse/Dxe/usbmouse.c index 063247376b..442b5a2139 100644 --- a/EdkModulePkg/Bus/Usb/UsbMouse/Dxe/usbmouse.c +++ b/EdkModulePkg/Bus/Usb/UsbMouse/Dxe/usbmouse.c @@ -906,12 +906,9 @@ UsbMouseReset ( --*/
{
USB_MOUSE_DEV *UsbMouseDevice;
- EFI_USB_IO_PROTOCOL *UsbIo;
UsbMouseDevice = USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL (This);
- UsbIo = UsbMouseDevice->UsbIo;
-
MouseReportStatusCode (
UsbMouseDevice->DevicePath,
EFI_PROGRESS_CODE,
|