Author: cfinck
Date: Sat Sep 29 02:32:34 2007
New Revision: 29288
URL:
http://svn.reactos.org/svn/reactos?rev=29288&view=rev
Log:
- Fix many warnings
- Fix a bug in id_dma.cpp on line 1261: This probably shouldn't be an assignment, but
a check, otherwise all ATI chips will be treated as Silicon Image chips
Modified:
trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp
trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp
trunk/reactos/drivers/storage/ide/uniata/id_init.cpp
trunk/reactos/drivers/storage/ide/uniata/id_probe.cpp
trunk/reactos/drivers/storage/ide/uniata/id_queue.cpp
trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp
Modified: trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
==============================================================================
--- trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp (original)
+++ trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp Sat Sep 29 02:32:34 2007
@@ -7979,7 +7979,6 @@
PUNICODE_STRING RegistryPath = (PUNICODE_STRING)Argument2;
BOOLEAN ReEnter = FALSE;
WCHAR a;
- NTSTATUS status;
PCONFIGURATION_INFORMATION GlobalConfig = IoGetConfigurationInformation();
BOOLEAN PrimaryClaimed = FALSE;
Modified: trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
==============================================================================
--- trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp (original)
+++ trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp Sat Sep 29 02:32:34 2007
@@ -1258,7 +1258,7 @@
case ATA_ATI_ID:
KdPrint2((PRINT_PREFIX "ATI\n"));
- if(ChipType = SIIMIO) {
+ if(ChipType == SIIMIO) {
goto l_ATA_SILICON_IMAGE_ID;
}
//goto ATA_SERVERWORKS_ID;
Modified: trunk/reactos/drivers/storage/ide/uniata/id_init.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
==============================================================================
--- trunk/reactos/drivers/storage/ide/uniata/id_init.cpp (original)
+++ trunk/reactos/drivers/storage/ide/uniata/id_init.cpp Sat Sep 29 02:32:34 2007
@@ -105,7 +105,7 @@
PCI_DEV_HW_SPEC_BM( 0730, 1039, 0x00, ATA_UDMA5, "SiS 730" , SIS100OLD
),
PCI_DEV_HW_SPEC_BM( 0646, 1039, 0x00, ATA_UDMA6, "SiS 645DX", SIS133NEW
),
-/* PCI_DEV_HW_SPEC_BM( 0645, 1039, 0x00, ATA_UDMA6, "SiS 645" ,
SIS133NEW ),
+/* PCI_DEV_HW_SPEC_BM( 0645, 1039, 0x00, ATA_UDMA6, "SiS 645" ,
SIS133NEW ),*/
/* PCI_DEV_HW_SPEC_BM( 0640, 1039, 0x00, ATA_UDMA4, "SiS 640" ,
SIS_SOUTH ),*/
PCI_DEV_HW_SPEC_BM( 0635, 1039, 0x00, ATA_UDMA5, "SiS 635" , SIS100NEW
),
PCI_DEV_HW_SPEC_BM( 0633, 1039, 0x00, ATA_UDMA5, "SiS 633" , SIS100NEW
),
@@ -175,7 +175,7 @@
// only by SouthBridge DeviceId
DevTypeInfo = (BUSMASTER_CONTROLLER_INFORMATION*)&ViaSouthAdapters[0];
i = AtapiFindListedDev(DevTypeInfo, -1, HwDeviceExtension, SystemIoBusNumber,
slotNumber, NULL);
- if(i != -1) {
+ if(i != 0xFFFFFFFF) {
KdPrint2((PRINT_PREFIX "VIASOUTH\n"));
deviceExtension->HwFlags |= VIASOUTH;
}
@@ -244,7 +244,7 @@
i = Ata_is_dev_listed(DevTypeInfo, VendorID, DeviceID, RevID, -1);
for_ugly_chips:
KdPrint2((PRINT_PREFIX "i: %#x\n", i));
- if(i == -1) {
+ if(i == 0xFFFFFFFF) {
return FALSE;
}
deviceExtension->MaxTransferMode = DevTypeInfo[i].MaxTransferMode;
@@ -299,7 +299,6 @@
BaseIoAddressBM = AtapiGetIoRange(HwDeviceExtension, ConfigInfo, pciData,
SystemIoBusNumber,
4, 0,
deviceExtension->NumberChannels*sizeof(IDE_BUSMASTER_REGISTERS));
for(c=0; c<deviceExtension->NumberChannels; c++) {
- ULONG unit01 = (c & 1);
ULONG unit10 = (c & 2);
chan = &deviceExtension->chan[c];
@@ -557,7 +556,7 @@
tmp32 == ATA_SIS5517) {
i =
AtapiFindListedDev((BUSMASTER_CONTROLLER_INFORMATION*)&SiSSouthAdapters[0],
-1, HwDeviceExtension, SystemIoBusNumber, -1, NULL);
- if(i != -1) {
+ if(i != 0xFFFFFFFF) {
deviceExtension->HwFlags = (deviceExtension->HwFlags &
~CHIPTYPE_MASK) | SIS133OLD;
//deviceExtension->MaxTransferMode = ATA_UDMA6;
deviceExtension->MaxTransferMode =
SiSSouthAdapters[i].MaxTransferMode;
@@ -822,7 +821,7 @@
&pciData,
PCI_COMMON_HDR_LENGTH);
- if (busDataRead < PCI_COMMON_HDR_LENGTH) {
+ if (busDataRead < (ULONG)PCI_COMMON_HDR_LENGTH) {
continue;
}
@@ -863,7 +862,6 @@
IN ULONG slotNumber
)
{
- PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
PCI_COMMON_CONFIG pciData;
ULONG funcNumber;
ULONG busDataRead;
@@ -887,7 +885,7 @@
&pciData,
PCI_COMMON_HDR_LENGTH);
- if (busDataRead < PCI_COMMON_HDR_LENGTH) {
+ if (busDataRead < (ULONG)PCI_COMMON_HDR_LENGTH) {
continue;
}
@@ -915,7 +913,6 @@
IN ULONG c
)
{
- PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
PCI_COMMON_CONFIG pciData;
ULONG funcNumber;
ULONG busDataRead;
@@ -941,7 +938,7 @@
&pciData,
PCI_COMMON_HDR_LENGTH);
- if (busDataRead < PCI_COMMON_HDR_LENGTH) {
+ if (busDataRead < (ULONG)PCI_COMMON_HDR_LENGTH) {
continue;
}
Modified: trunk/reactos/drivers/storage/ide/uniata/id_probe.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
==============================================================================
--- trunk/reactos/drivers/storage/ide/uniata/id_probe.cpp (original)
+++ trunk/reactos/drivers/storage/ide/uniata/id_probe.cpp Sat Sep 29 02:32:34 2007
@@ -74,7 +74,7 @@
VOID
AtapiDoNothing(VOID)
{
- ULONG i = 0;
+ //ULONG i = 0;
return;
} // end AtapiDoNothing()
@@ -250,7 +250,7 @@
if(busDataRead == 2)
continue;
- if(busDataRead < PCI_COMMON_HDR_LENGTH)
+ if(busDataRead < (ULONG)PCI_COMMON_HDR_LENGTH)
continue;
VendorID = pciData.VendorID;
@@ -289,7 +289,7 @@
//known = UniataChipDetect(HwDeviceExtension, NULL, -1, ConfigInfo,
&SimplexOnly);
i =
Ata_is_dev_listed((PBUSMASTER_CONTROLLER_INFORMATION)&BusMasterAdapters[0], VendorID,
DeviceID, 0, NUM_BUSMASTER_ADAPTERS);
- known = (i != -1);
+ known = (i != 0xFFFFFFFF);
if(known) {
RaidFlags = BusMasterAdapters[i].RaidFlags;
if((RaidFlags & UNIATA_RAID_CONTROLLER) &&
@@ -476,8 +476,8 @@
/* if(known) {
RtlCopyMemory(newBMListPtr,
(PVOID)&(BusMasterAdapters[i]), sizeof(BUSMASTER_CONTROLLER_INFORMATION));
} else {*/
- sprintf((PCHAR)vendorStrPtr, "%4.4x", VendorID);
- sprintf((PCHAR)deviceStrPtr, "%4.4x", DeviceID);
+ sprintf((PCHAR)vendorStrPtr, "%4.4x", (UINT)VendorID);
+ sprintf((PCHAR)deviceStrPtr, "%4.4x", (UINT)DeviceID);
RtlCopyMemory(&(newBMListPtr->VendorIdStr),
(PCHAR)vendorStrPtr, 4);
RtlCopyMemory(&(newBMListPtr->DeviceIdStr),
(PCHAR)deviceStrPtr, 4);
@@ -591,7 +591,7 @@
ULONG i;
// set start/end bus
- if(BusNumber == -1) {
+ if(BusNumber == 0xFFFFFFFF) {
busNumber = 0;
busNumber2 = maxPciBus;
} else {
@@ -599,7 +599,7 @@
busNumber2 = BusNumber+1;
}
// set start/end slot
- if(SlotNumber == -1) {
+ if(SlotNumber == 0xFFFFFFFF) {
slotNumber = 0;
slotNumber2 = PCI_MAX_DEVICES;
} else {
@@ -627,11 +627,11 @@
if(busDataRead == 2)
continue;
- if(busDataRead < PCI_COMMON_HDR_LENGTH)
+ if(busDataRead < (ULONG)PCI_COMMON_HDR_LENGTH)
continue;
i = Ata_is_dev_listed(BusMasterAdapters, pciData.VendorID, pciData.DeviceID,
pciData.RevisionID, lim);
- if(i != -1) {
+ if(i != 0xFFFFFFFF) {
if(_slotData)
*_slotData = slotData;
return i;
@@ -679,7 +679,7 @@
&pciData,
PCI_COMMON_HDR_LENGTH);
- if (busDataRead < PCI_COMMON_HDR_LENGTH) {
+ if (busDataRead < (ULONG)PCI_COMMON_HDR_LENGTH) {
continue;
}
@@ -733,7 +733,7 @@
#ifndef UNIATA_CORE
// this buffer must be global for UNIATA_CORE build
PCI_COMMON_CONFIG pciData;
-#endif UNIATA_CORE
+#endif //UNIATA_CORE
ULONG slotNumber;
ULONG busDataRead;
ULONG SystemIoBusNumber;
@@ -764,7 +764,7 @@
BOOLEAN found = FALSE;
BOOLEAN MasterDev;
BOOLEAN simplexOnly = FALSE;
- BOOLEAN skip_find_dev = FALSE;
+ //BOOLEAN skip_find_dev = FALSE;
BOOLEAN AltInit = FALSE;
SCSI_PHYSICAL_ADDRESS IoBasePort1;
@@ -841,7 +841,7 @@
PCI_COMMON_HDR_LENGTH);
#ifndef UNIATA_CORE
- if (busDataRead < PCI_COMMON_HDR_LENGTH) {
+ if (busDataRead < (ULONG)PCI_COMMON_HDR_LENGTH) {
KdPrint2((PRINT_PREFIX "busDataRead < PCI_COMMON_HDR_LENGTH =>
SP_RETURN_ERROR\n"));
return SP_RETURN_ERROR;
}
Modified: trunk/reactos/drivers/storage/ide/uniata/id_queue.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
==============================================================================
--- trunk/reactos/drivers/storage/ide/uniata/id_queue.cpp (original)
+++ trunk/reactos/drivers/storage/ide/uniata/id_queue.cpp Sat Sep 29 02:32:34 2007
@@ -129,7 +129,7 @@
// walk through command queue and find the best
// place for insertion of the command
- while (AtaReq1 = AtaReq2->prev_req) {
+ while ((AtaReq1 = AtaReq2->prev_req)) {
new_cost1 = UniataGetCost(LunExt, AtaReq1, AtaReq);
new_cost2 = UniataGetCost(LunExt, AtaReq, AtaReq2);
@@ -181,7 +181,7 @@
AtaReq->prev_req = BestAtaReq1;
AtaReq1 = AtaReq;
- while(AtaReq1 = AtaReq1->next_req) {
+ while((AtaReq1 = AtaReq1->next_req)) {
//ASSERT(AtaReq1->ttl);
AtaReq1->ttl--;
}
Modified: trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
==============================================================================
--- trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp (original)
+++ trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp Sat Sep 29 02:32:34 2007
@@ -7,7 +7,7 @@
)
{
PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
- ULONG Channel = deviceExtension->Channel + lChannel;
+ //ULONG Channel = deviceExtension->Channel + lChannel;
PHW_CHANNEL chan = &deviceExtension->chan[lChannel];
SATA_SSTATUS_REG SStatus;
ULONG i;
@@ -126,7 +126,7 @@
{
PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
PHW_CHANNEL chan = &deviceExtension->chan[lChannel];
- ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK;
+ //ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK;
SATA_SSTATUS_REG SStatus;
SATA_SERROR_REG SError;