diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-09-15 07:48:11 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-09-15 07:48:11 +0000 |
commit | c9325700d0ef25eaf45077928af3f93b15ac5fe0 (patch) | |
tree | c46ae68c26db3a5a6a9e58b37b53265aa2f770d3 /MdeModulePkg/Bus | |
parent | f6b4e53dfe43c27d448cedb57059e5b7ca236dd8 (diff) | |
download | edk2-platforms-c9325700d0ef25eaf45077928af3f93b15ac5fe0.tar.xz |
Refine soma code to make code run safely.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10877 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus')
7 files changed, 16 insertions, 16 deletions
diff --git a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c index 6f1a6a10e1..3d581b69fd 100644 --- a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c @@ -346,7 +346,7 @@ PCheckDevice ( Dsc = (EFI_PCI_RESOUCE_DESCRIPTOR *) (ListPtr + 1);
AcpiPtr->Desc = ACPI_ADDRESS_SPACE_DESCRIPTOR;
- AcpiPtr->Len = sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR);
+ AcpiPtr->Len = (UINT16) sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR);
AcpiPtr->ResType = (UINT8) Dsc->ResType;
AcpiPtr->GenFlag = (UINT8) Dsc->GenFlag;
AcpiPtr->SpecificFlag = (UINT8) Dsc->SpecificFlag;
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c index fca0084016..09b58ac0de 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c @@ -983,7 +983,7 @@ PciHostBridgeAdjustAllocation ( // Have no way to get ReqRes, AllocRes & Bar here
//
ZeroMem (&AllocFailExtendedData, sizeof (AllocFailExtendedData));
- AllocFailExtendedData.DevicePathSize = sizeof (EFI_DEVICE_PATH_PROTOCOL);
+ AllocFailExtendedData.DevicePathSize = (UINT16) sizeof (EFI_DEVICE_PATH_PROTOCOL);
AllocFailExtendedData.DevicePath = (UINT8 *) PciResNode->PciDev->DevicePath;
AllocFailExtendedData.Bar = PciResNode->Bar;
@@ -1108,7 +1108,7 @@ ConstructAcpiResourceRequestor ( //
if ((Aperture & 0x01) != 0) {
Ptr->Desc = ACPI_ADDRESS_SPACE_DESCRIPTOR;
- Ptr->Len = sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) - 3;
+ Ptr->Len = (UINT16) (sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) - 3);
//
// Io
//
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c index fe67dc20cd..0969407831 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c @@ -1637,7 +1637,7 @@ PciIoGetBarAttributes ( if (NumConfig == 1) {
Ptr->Desc = ACPI_ADDRESS_SPACE_DESCRIPTOR;
- Ptr->Len = sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) - 3;
+ Ptr->Len = (UINT16) (sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) - 3);
Ptr->AddrRangeMin = PciIoDevice->PciBar[BarIndex].BaseAddress;
Ptr->AddrLen = PciIoDevice->PciBar[BarIndex].Length;
diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/UhciQueue.c b/MdeModulePkg/Bus/Pci/UhciDxe/UhciQueue.c index 7a53f36a60..1a0aa6e636 100644 --- a/MdeModulePkg/Bus/Pci/UhciDxe/UhciQueue.c +++ b/MdeModulePkg/Bus/Pci/UhciDxe/UhciQueue.c @@ -355,7 +355,7 @@ UhciCreateSetupTd ( Td->TdHw.DataBuffer = (UINT32) (UINTN) RequestPhy;
Td->Data = Request;
- Td->DataLen = sizeof (EFI_USB_DEVICE_REQUEST);
+ Td->DataLen = (UINT16) sizeof (EFI_USB_DEVICE_REQUEST);
return Td;
}
diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c index 3e510a65a7..e6d963672e 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c +++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c @@ -1165,7 +1165,7 @@ DiscoverScsiDevice ( // Using Inquiry command to scan for the device
//
InquiryDataLength = sizeof (EFI_SCSI_INQUIRY_DATA);
- SenseDataLength = sizeof (EFI_SCSI_SENSE_DATA);
+ SenseDataLength = (UINT8) sizeof (EFI_SCSI_SENSE_DATA);
Status = ScsiInquiryCommand (
&ScsiIoDevice->ScsiIo,
diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c index 72c9f9d0b5..c1d96b936e 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c @@ -1429,7 +1429,7 @@ ScsiDiskRequestSenseKeys ( UINT8 TargetStatus;
FallStatus = EFI_SUCCESS;
- SenseDataLength = sizeof (EFI_SCSI_SENSE_DATA);
+ SenseDataLength = (UINT8) sizeof (EFI_SCSI_SENSE_DATA);
ZeroMem (
ScsiDiskDevice->SenseData,
@@ -2694,7 +2694,7 @@ AtapiIdentifyDevice ( Cdb[0] = ATA_CMD_IDENTIFY_DEVICE;
CommandPacket.Timeout = EFI_TIMER_PERIOD_SECONDS (1);
CommandPacket.Cdb = Cdb;
- CommandPacket.CdbLength = sizeof (Cdb);
+ CommandPacket.CdbLength = (UINT8) sizeof (Cdb);
CommandPacket.InDataBuffer = &ScsiDiskDevice->IdentifyData;
CommandPacket.InTransferLength = sizeof (ScsiDiskDevice->IdentifyData);
diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c index 70d27468d5..72a53f1fc8 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c @@ -50,7 +50,7 @@ UsbBootRequestSense ( SenseCmd.OpCode = USB_BOOT_REQUEST_SENSE_OPCODE;
SenseCmd.Lun = (UINT8) (USB_BOOT_LUN (UsbMass->Lun));
- SenseCmd.AllocLen = sizeof (USB_BOOT_REQUEST_SENSE_DATA);
+ SenseCmd.AllocLen = (UINT8) sizeof (USB_BOOT_REQUEST_SENSE_DATA);
Status = Transport->ExecCommand (
UsbMass->Context,
@@ -289,7 +289,7 @@ UsbBootIsUnitReady ( return UsbBootExecCmdWithRetry (
UsbMass,
&TestCmd,
- sizeof (USB_BOOT_TEST_UNIT_READY_CMD),
+ (UINT8) sizeof (USB_BOOT_TEST_UNIT_READY_CMD),
EfiUsbNoData,
NULL,
0,
@@ -325,12 +325,12 @@ UsbBootInquiry ( InquiryCmd.OpCode = USB_BOOT_INQUIRY_OPCODE;
InquiryCmd.Lun = (UINT8) (USB_BOOT_LUN (UsbMass->Lun));
- InquiryCmd.AllocLen = sizeof (InquiryData);
+ InquiryCmd.AllocLen = (UINT8) sizeof (InquiryData);
Status = UsbBootExecCmdWithRetry (
UsbMass,
&InquiryCmd,
- sizeof (USB_BOOT_INQUIRY_CMD),
+ (UINT8) sizeof (USB_BOOT_INQUIRY_CMD),
EfiUsbDataIn,
&InquiryData,
sizeof (USB_BOOT_INQUIRY_DATA),
@@ -392,7 +392,7 @@ UsbBootReadCapacity ( Status = UsbBootExecCmdWithRetry (
UsbMass,
&CapacityCmd,
- sizeof (USB_BOOT_READ_CAPACITY_CMD),
+ (UINT8) sizeof (USB_BOOT_READ_CAPACITY_CMD),
EfiUsbDataIn,
&CapacityData,
sizeof (USB_BOOT_READ_CAPACITY_DATA),
@@ -460,7 +460,7 @@ UsbScsiModeSense ( Status = UsbBootExecCmdWithRetry (
UsbMass,
&ModeSenseCmd,
- sizeof (USB_SCSI_MODE_SENSE6_CMD),
+ (UINT8) sizeof (USB_SCSI_MODE_SENSE6_CMD),
EfiUsbDataIn,
&ModeParaHeader,
sizeof (USB_SCSI_MODE_SENSE6_PARA_HEADER),
@@ -704,7 +704,7 @@ UsbBootReadBlocks ( Status = UsbBootExecCmdWithRetry (
UsbMass,
&ReadCmd,
- sizeof (USB_BOOT_READ10_CMD),
+ (UINT8) sizeof (USB_BOOT_READ10_CMD),
EfiUsbDataIn,
Buffer,
ByteSize,
@@ -780,7 +780,7 @@ UsbBootWriteBlocks ( Status = UsbBootExecCmdWithRetry (
UsbMass,
&WriteCmd,
- sizeof (USB_BOOT_WRITE10_CMD),
+ (UINT8) sizeof (USB_BOOT_WRITE10_CMD),
EfiUsbDataOut,
Buffer,
ByteSize,
|