[ros-diffs] [tfaber] 56668: [LIBUSB][USBCCGP] - Whitespace and DPRINT fixes

tfaber at svn.reactos.org tfaber at svn.reactos.org
Mon May 28 10:49:44 UTC 2012


Author: tfaber
Date: Mon May 28 10:49:44 2012
New Revision: 56668

URL: http://svn.reactos.org/svn/reactos?rev=56668&view=rev
Log:
[LIBUSB][USBCCGP]
- Whitespace and DPRINT fixes

Modified:
    trunk/reactos/drivers/usb/usbccgp/function.c
    trunk/reactos/drivers/usb/usbccgp/misc.c
    trunk/reactos/drivers/usb/usbccgp/pdo.c
    trunk/reactos/lib/drivers/libusb/hub_controller.cpp
    trunk/reactos/lib/drivers/libusb/usb_device.cpp

Modified: trunk/reactos/drivers/usb/usbccgp/function.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbccgp/function.c?rev=56668&r1=56667&r2=56668&view=diff
==============================================================================
--- trunk/reactos/drivers/usb/usbccgp/function.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbccgp/function.c [iso-8859-1] Mon May 28 10:49:44 2012
@@ -56,7 +56,7 @@
     //
     // initialize request
     //
-    Stack=IoGetNextIrpStackLocation(Irp);
+    Stack = IoGetNextIrpStackLocation(Irp);
     Stack->MajorFunction = IRP_MJ_PNP;
     Stack->MinorFunction = IRP_MN_QUERY_INTERFACE;
     Stack->Parameters.QueryInterface.Size = sizeof(BUS_INTERFACE_STANDARD);
@@ -69,7 +69,7 @@
     //
     // call driver
     //
-    Status= IoCallDriver(DeviceObject, Irp);
+    Status = IoCallDriver(DeviceObject, Irp);
 
     //
     // did operation complete
@@ -116,14 +116,14 @@
     //
     // invoke callback
     //
-    Status = FDODeviceExtension->BusInterface.StartDeviceCallback(FDODeviceExtension->DeviceDescriptor, 
-                                                                  FDODeviceExtension->ConfigurationDescriptor, 
+    Status = FDODeviceExtension->BusInterface.StartDeviceCallback(FDODeviceExtension->DeviceDescriptor,
+                                                                  FDODeviceExtension->ConfigurationDescriptor,
                                                                   &FunctionDescriptorBuffer,
                                                                   &FunctionDescriptorBufferLength,
                                                                   DeviceObject,
                                                                   FDODeviceExtension->PhysicalDeviceObject);
 
-    DPRINT("USBCCGP_CustomEnumWithInterface Status %x\n", Status);
+    DPRINT("USBCCGP_CustomEnumWithInterface Status %lx\n", Status);
     if (!NT_SUCCESS(Status))
     {
         //
@@ -167,7 +167,7 @@
     Offset = (PUCHAR)ConfigurationDescriptor + ConfigurationDescriptor->bLength;
     End = (PUCHAR)ConfigurationDescriptor + ConfigurationDescriptor->wTotalLength;
 
-    while(Offset < End)
+    while (Offset < End)
     {
         //
         // get association descriptor
@@ -209,7 +209,7 @@
     Offset = (PUCHAR)ConfigurationDescriptor + ConfigurationDescriptor->bLength;
     End = (PUCHAR)ConfigurationDescriptor + ConfigurationDescriptor->wTotalLength;
 
-    while(Offset < End)
+    while (Offset < End)
     {
         //
         // get association descriptor
@@ -260,7 +260,7 @@
     Offset = (PUCHAR)AssociationDescriptor + AssociationDescriptor->bLength;
     End = (PUCHAR)ConfigurationDescriptor + ConfigurationDescriptor->wTotalLength;
 
-    while(Offset < End)
+    while (Offset < End)
     {
         //
         // get association descriptor
@@ -358,8 +358,8 @@
         // get interface description
         //
          Status = USBCCGP_GetStringDescriptor(FDODeviceExtension->NextDeviceObject,
-                                              100 * sizeof(WCHAR), 
-                                              Descriptor->iFunction, 
+                                              100 * sizeof(WCHAR),
+                                              Descriptor->iFunction,
                                               0x0409, //FIXME
                                               (PVOID*)&DescriptionBuffer);
         if (!NT_SUCCESS(Status))
@@ -406,7 +406,6 @@
     FunctionDescriptor->HardwareId.Length = Index * sizeof(WCHAR);
     FunctionDescriptor->HardwareId.MaximumLength = (Index + 1) * sizeof(WCHAR);
 
-
     //
     // now init the compatible id
     //
@@ -475,7 +474,7 @@
         return STATUS_INSUFFICIENT_RESOURCES;
     }
 
-    for(Index = 0; Index < DescriptorCount; Index++)
+    for (Index = 0; Index < DescriptorCount; Index++)
     {
         //
         // init function descriptors
@@ -552,8 +551,8 @@
                                                                          FDODeviceExtension->DeviceDescriptor->bcdDevice,
                                                                          FunctionIndex) + 1;
     Index += swprintf(&Buffer[Index], L"USB\\VID_%04x&PID_%04x&MI_%02x", FDODeviceExtension->DeviceDescriptor->idVendor,
-                                                                        FDODeviceExtension->DeviceDescriptor->idProduct,
-                                                                        FunctionIndex) + 1;
+                                                                         FDODeviceExtension->DeviceDescriptor->idProduct,
+                                                                         FunctionIndex) + 1;
 
     // allocate result buffer
     DescriptionBuffer = AllocateItem(NonPagedPool, (Index + 1) * sizeof(WCHAR));
@@ -637,7 +636,7 @@
     //
     // init function descriptors
     //
-    for(Index = 0; Index < FDODeviceExtension->ConfigurationDescriptor->bNumInterfaces; Index++)
+    for (Index = 0; Index < FDODeviceExtension->ConfigurationDescriptor->bNumInterfaces; Index++)
     {
         // get interface descriptor
         InterfaceDescriptor = USBD_ParseConfigurationDescriptorEx(FDODeviceExtension->ConfigurationDescriptor, FDODeviceExtension->ConfigurationDescriptor, Index, 0, -1, -1, -1);
@@ -679,7 +678,7 @@
             //
             // failed to init ids
             //
-            DPRINT1("[USBCCGP] Failed to init ids with %x\n", Status);
+            DPRINT1("[USBCCGP] Failed to init ids with %lx\n", Status);
             return Status;
         }
 
@@ -722,7 +721,7 @@
     //
     // first check if all interfaces belong to the same audio class
     //
-    for(Index = 0; Index < FDODeviceExtension->ConfigurationDescriptor->bNumInterfaces; Index++)
+    for (Index = 0; Index < FDODeviceExtension->ConfigurationDescriptor->bNumInterfaces; Index++)
     {
         //
         // get interface descriptor
@@ -789,7 +788,7 @@
         //
         // failed to allocate descriptor array
         //
-        DPRINT1("[USBCCGP] Failed to allocate descriptor array %x\n", Status);
+        DPRINT1("[USBCCGP] Failed to allocate descriptor array %lx\n", Status);
         return Status;
     }
 
@@ -802,7 +801,7 @@
         //
         // failed to init ids
         //
-        DPRINT1("[USBCCGP] Failed to init ids with %x\n", Status);
+        DPRINT1("[USBCCGP] Failed to init ids with %lx\n", Status);
         return Status;
     }
 

Modified: trunk/reactos/drivers/usb/usbccgp/misc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbccgp/misc.c?rev=56668&r1=56667&r2=56668&view=diff
==============================================================================
--- trunk/reactos/drivers/usb/usbccgp/misc.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbccgp/misc.c [iso-8859-1] Mon May 28 10:49:44 2012
@@ -18,7 +18,7 @@
 NTAPI
 USBSTOR_SyncForwardIrpCompletionRoutine(
     PDEVICE_OBJECT DeviceObject,
-    PIRP Irp, 
+    PIRP Irp,
     PVOID Context)
 {
     if (Irp->PendingReturned)
@@ -162,7 +162,7 @@
 
 
     DPRINT1("FunctionCount %lu\n", FunctionDescriptorCount);
-    for(Index = 0; Index < FunctionDescriptorCount; Index++)
+    for (Index = 0; Index < FunctionDescriptorCount; Index++)
     {
         DPRINT1("Function %lu\n", Index);
         DPRINT1("FunctionNumber %lu\n", FunctionDescriptor[Index].FunctionNumber);

Modified: trunk/reactos/drivers/usb/usbccgp/pdo.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbccgp/pdo.c?rev=56668&r1=56667&r2=56668&view=diff
==============================================================================
--- trunk/reactos/drivers/usb/usbccgp/pdo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbccgp/pdo.c [iso-8859-1] Mon May 28 10:49:44 2012
@@ -136,7 +136,7 @@
     // count length of string
     //
     String = DeviceId;
-    while(*String)
+    while (*String)
     {
         StringLength = wcslen(String) + 1;
         Length += StringLength;
@@ -161,7 +161,7 @@
     //
     *OutString = String;
 
-    while(*DeviceId)
+    while (*DeviceId)
     {
         StringLength = swprintf(String, L"%s&MI_%02x", DeviceId, InterfaceNumber) + 1;
         Length = wcslen(DeviceId) + 1;
@@ -225,7 +225,7 @@
                 DPRINT("BusQueryDeviceID %S\n", Buffer);
 
                 ExFreePool((PVOID)Irp->IoStatus.Information);
-                Irp->IoStatus .Information = (ULONG_PTR)Buffer;
+                Irp->IoStatus.Information = (ULONG_PTR)Buffer;
             }
             else
             {
@@ -334,76 +334,76 @@
 
     switch(IoStack->MinorFunction)
     {
-       case IRP_MN_QUERY_DEVICE_RELATIONS:
-       {
-           //
-           // handle device relations
-           //
-           Status = USBCCGP_PdoHandleDeviceRelations(DeviceObject, Irp);
-           break;
-       }
-       case IRP_MN_QUERY_DEVICE_TEXT:
-       {
-           //
-           // handle query device text
-           //
-           Status = USBCCGP_PdoHandleQueryDeviceText(DeviceObject, Irp);
-           break;
-       }
-       case IRP_MN_QUERY_ID:
-       {
-           //
-           // handle request
-           //
-           Status = USBCCGP_PdoHandleQueryId(DeviceObject, Irp);
-           break;
-       }
-       case IRP_MN_REMOVE_DEVICE:
-       {
-           //
-           // remove us from the fdo's pdo list
-           //
-           bFound = FALSE;
-           for(Index = 0; Index < PDODeviceExtension->FDODeviceExtension->FunctionDescriptorCount; Index++)
-           {
-               if (PDODeviceExtension->FDODeviceExtension->ChildPDO[Index] == DeviceObject)
-               {
-                   //
-                   // remove us
-                   //
-                   PDODeviceExtension->FDODeviceExtension->ChildPDO[Index] = NULL;
-                   bFound = TRUE;
-                   break;
-               }
-           }
-
-           //
-           // Complete the IRP
-           //
-           Irp->IoStatus.Status = STATUS_SUCCESS;
-           IoCompleteRequest(Irp, IO_NO_INCREMENT);
-
-           if (bFound)
-           {
-               //
-               // Delete the device object
-               //
-               IoDeleteDevice(DeviceObject);
-           }
-           return STATUS_SUCCESS;
-       }
-       case IRP_MN_QUERY_CAPABILITIES:
-       {
-           //
-           // copy device capabilities
-           //
-           RtlCopyMemory(IoStack->Parameters.DeviceCapabilities.Capabilities, &PDODeviceExtension->Capabilities, sizeof(DEVICE_CAPABILITIES));
-
-           /* Complete the IRP */
-           Irp->IoStatus.Status = STATUS_SUCCESS;
-           IoCompleteRequest(Irp, IO_NO_INCREMENT);
-           return STATUS_SUCCESS;
-       }
+        case IRP_MN_QUERY_DEVICE_RELATIONS:
+        {
+            //
+            // handle device relations
+            //
+            Status = USBCCGP_PdoHandleDeviceRelations(DeviceObject, Irp);
+            break;
+        }
+        case IRP_MN_QUERY_DEVICE_TEXT:
+        {
+            //
+            // handle query device text
+            //
+            Status = USBCCGP_PdoHandleQueryDeviceText(DeviceObject, Irp);
+            break;
+        }
+        case IRP_MN_QUERY_ID:
+        {
+            //
+            // handle request
+            //
+            Status = USBCCGP_PdoHandleQueryId(DeviceObject, Irp);
+            break;
+        }
+        case IRP_MN_REMOVE_DEVICE:
+        {
+            //
+            // remove us from the fdo's pdo list
+            //
+            bFound = FALSE;
+            for(Index = 0; Index < PDODeviceExtension->FDODeviceExtension->FunctionDescriptorCount; Index++)
+            {
+                if (PDODeviceExtension->FDODeviceExtension->ChildPDO[Index] == DeviceObject)
+                {
+                    //
+                    // remove us
+                    //
+                    PDODeviceExtension->FDODeviceExtension->ChildPDO[Index] = NULL;
+                    bFound = TRUE;
+                    break;
+                }
+            }
+
+            //
+            // Complete the IRP
+            //
+            Irp->IoStatus.Status = STATUS_SUCCESS;
+            IoCompleteRequest(Irp, IO_NO_INCREMENT);
+
+            if (bFound)
+            {
+                //
+                // Delete the device object
+                //
+                IoDeleteDevice(DeviceObject);
+            }
+            return STATUS_SUCCESS;
+        }
+        case IRP_MN_QUERY_CAPABILITIES:
+        {
+            //
+            // copy device capabilities
+            //
+            RtlCopyMemory(IoStack->Parameters.DeviceCapabilities.Capabilities, &PDODeviceExtension->Capabilities, sizeof(DEVICE_CAPABILITIES));
+
+            /* Complete the IRP */
+            Irp->IoStatus.Status = STATUS_SUCCESS;
+            IoCompleteRequest(Irp, IO_NO_INCREMENT);
+            return STATUS_SUCCESS;
+        }
         case IRP_MN_QUERY_REMOVE_DEVICE:
         case IRP_MN_QUERY_STOP_DEVICE:
         {
@@ -413,24 +413,24 @@
             Status = STATUS_SUCCESS;
             break;
         }
-       case IRP_MN_START_DEVICE:
-       {
-           //
-           // no-op for PDO
-           //
-           DPRINT("[USBCCGP] PDO IRP_MN_START\n");
-           Status = STATUS_SUCCESS;
-           break;
-       }
-       case IRP_MN_QUERY_INTERFACE:
-       {
-           //
-           // forward to lower device object
-           //
-           IoSkipCurrentIrpStackLocation(Irp);
-           return IoCallDriver(PDODeviceExtension->NextDeviceObject, Irp);
-       }
-       default:
+        case IRP_MN_START_DEVICE:
+        {
+            //
+            // no-op for PDO
+            //
+            DPRINT("[USBCCGP] PDO IRP_MN_START\n");
+            Status = STATUS_SUCCESS;
+            break;
+        }
+        case IRP_MN_QUERY_INTERFACE:
+        {
+            //
+            // forward to lower device object
+            //
+            IoSkipCurrentIrpStackLocation(Irp);
+            return IoCallDriver(PDODeviceExtension->NextDeviceObject, Irp);
+        }
+        default:
         {
             //
             // do nothing
@@ -465,7 +465,7 @@
 
 NTSTATUS
 USBCCGP_BuildConfigurationDescriptor(
-    PDEVICE_OBJECT DeviceObject, 
+    PDEVICE_OBJECT DeviceObject,
     PIRP Irp)
 {
     PIO_STACK_LOCATION IoStack;
@@ -501,7 +501,7 @@
     //
     TotalSize = sizeof(USB_CONFIGURATION_DESCRIPTOR);
 
-    for(Index = 0; Index < PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces; Index++)
+    for (Index = 0; Index < PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces; Index++)
     {
         //
         // get current interface descriptor
@@ -555,7 +555,7 @@
             // move to next descriptor
             //
             InterfaceDescriptor = (PUSB_INTERFACE_DESCRIPTOR)((ULONG_PTR)InterfaceDescriptor + InterfaceDescriptor->bLength);
-        }while(TRUE);
+        } while(TRUE);
     }
 
     //
@@ -577,7 +577,7 @@
     RtlCopyMemory(Buffer, ConfigurationDescriptor, sizeof(USB_CONFIGURATION_DESCRIPTOR));
     BufferPtr = (PUCHAR)((ULONG_PTR)Buffer + ConfigurationDescriptor->bLength);
 
-    for(Index = 0; Index < PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces; Index++)
+    for (Index = 0; Index < PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces; Index++)
     {
         //
         // get current interface descriptor
@@ -634,7 +634,7 @@
             // move to next descriptor
             //
             InterfaceDescriptor = (PUSB_INTERFACE_DESCRIPTOR)((ULONG_PTR)InterfaceDescriptor + InterfaceDescriptor->bLength);
-        }while(TRUE);
+        } while(TRUE);
     }
 
     //
@@ -674,7 +674,7 @@
 
 NTSTATUS
 USBCCGP_PDOSelectConfiguration(
-    PDEVICE_OBJECT DeviceObject, 
+    PDEVICE_OBJECT DeviceObject,
     PIRP Irp)
 {
     PIO_STACK_LOCATION IoStack;
@@ -736,7 +736,7 @@
         // search for the interface in the local interface list
         //
         FoundInterface = FALSE;
-        for(InterfaceIndex = 0; InterfaceIndex < PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces; InterfaceIndex++)
+        for (InterfaceIndex = 0; InterfaceIndex < PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces; InterfaceIndex++)
         {
             if (PDODeviceExtension->FunctionDescriptor->InterfaceDescriptorList[InterfaceIndex]->bInterfaceNumber == InterfaceInformation->InterfaceNumber)
             {
@@ -760,7 +760,7 @@
         // now query the total interface list
         //
         Entry = NULL;
-        for(InterfaceIndex = 0; InterfaceIndex < PDODeviceExtension->InterfaceListCount; InterfaceIndex++)
+        for (InterfaceIndex = 0; InterfaceIndex < PDODeviceExtension->InterfaceListCount; InterfaceIndex++)
         {
             if (PDODeviceExtension->InterfaceList[InterfaceIndex].Interface->InterfaceNumber == InterfaceInformation->InterfaceNumber)
             {
@@ -786,7 +786,6 @@
         NeedSelect = FALSE;
         if (Entry->InterfaceDescriptor->bAlternateSetting == InterfaceInformation->AlternateSetting)
         {
-            
             for(InterfaceIndex = 0; InterfaceIndex < InterfaceInformation->NumberOfPipes; InterfaceIndex++)
             {
                 if (InterfaceInformation->Pipes[InterfaceIndex].MaximumTransferSize != Entry->Interface->Pipes[InterfaceIndex].MaximumTransferSize)
@@ -894,7 +893,7 @@
             FreeItem(NewUrb);
         }
 
-    }while(Length);
+    } while(Length);
 
     //
     // store configuration handle
@@ -911,7 +910,7 @@
 
 NTSTATUS
 PDO_HandleInternalDeviceControl(
-    PDEVICE_OBJECT DeviceObject, 
+    PDEVICE_OBJECT DeviceObject,
     PIRP Irp)
 {
     PIO_STACK_LOCATION IoStack;
@@ -950,7 +949,7 @@
         }
         else if (Urb->UrbHeader.Function == URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE)
         {
-            if(Urb->UrbControlDescriptorRequest.DescriptorType == USB_DEVICE_DESCRIPTOR_TYPE)
+            if (Urb->UrbControlDescriptorRequest.DescriptorType == USB_DEVICE_DESCRIPTOR_TYPE)
             {
                 //
                 // is the buffer big enough
@@ -1047,8 +1046,6 @@
         return Status;
     }
 
-
-
     DPRINT1("IOCTL %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode);
     DPRINT1("InputBufferLength %lu\n", IoStack->Parameters.DeviceIoControl.InputBufferLength);
     DPRINT1("OutputBufferLength %lu\n", IoStack->Parameters.DeviceIoControl.OutputBufferLength);
@@ -1064,7 +1061,7 @@
 
 NTSTATUS
 PDO_Dispatch(
-    PDEVICE_OBJECT DeviceObject, 
+    PDEVICE_OBJECT DeviceObject,
     PIRP Irp)
 {
     PIO_STACK_LOCATION IoStack;
@@ -1085,5 +1082,4 @@
             IoCompleteRequest(Irp, IO_NO_INCREMENT);
             return Status;
     }
-
 }

Modified: trunk/reactos/lib/drivers/libusb/hub_controller.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/hub_controller.cpp?rev=56668&r1=56667&r2=56668&view=diff
==============================================================================
--- trunk/reactos/lib/drivers/libusb/hub_controller.cpp [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/libusb/hub_controller.cpp [iso-8859-1] Mon May 28 10:49:44 2012
@@ -965,7 +965,7 @@
                     Status = m_Hardware->ClearPortStatus(PortId, C_PORT_CONNECTION);
                     break;
                 case C_PORT_RESET:
-                    Status= m_Hardware->ClearPortStatus(PortId, C_PORT_RESET);
+                    Status = m_Hardware->ClearPortStatus(PortId, C_PORT_RESET);
                     break;
                 default:
                     DPRINT("[USBLIB] Unknown Value for Clear Feature %x \n", Urb->UrbControlVendorClassRequest.Value);
@@ -1209,31 +1209,30 @@
     UsbDevice = PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle);
 
 
-     //
-     // generate setup packet
-     //
-     CtrlSetup.bRequest = USB_REQUEST_GET_STATUS;
-     CtrlSetup.wValue.LowByte = 0;
-     CtrlSetup.wValue.HiByte = 0;
-     CtrlSetup.wIndex.W = Urb->UrbControlGetStatusRequest.Index;
-     CtrlSetup.wLength = (USHORT)Urb->UrbControlGetStatusRequest.TransferBufferLength;
-     CtrlSetup.bmRequestType.B = 0x80;
-
-
-     if (Urb->UrbHeader.Function == URB_FUNCTION_GET_STATUS_FROM_INTERFACE)
-     {
-         //
-         // add interface type
-         //
-         CtrlSetup.bmRequestType.B |= 0x01;
-     }
-     else if (Urb->UrbHeader.Function == URB_FUNCTION_GET_STATUS_FROM_ENDPOINT)
-     {
-         //
-         // add interface type
-         //
-         CtrlSetup.bmRequestType.B |= 0x02;
-     }
+    //
+    // generate setup packet
+    //
+    CtrlSetup.bRequest = USB_REQUEST_GET_STATUS;
+    CtrlSetup.wValue.LowByte = 0;
+    CtrlSetup.wValue.HiByte = 0;
+    CtrlSetup.wIndex.W = Urb->UrbControlGetStatusRequest.Index;
+    CtrlSetup.wLength = (USHORT)Urb->UrbControlGetStatusRequest.TransferBufferLength;
+    CtrlSetup.bmRequestType.B = 0x80;
+
+    if (Urb->UrbHeader.Function == URB_FUNCTION_GET_STATUS_FROM_INTERFACE)
+    {
+        //
+        // add interface type
+        //
+        CtrlSetup.bmRequestType.B |= 0x01;
+    }
+    else if (Urb->UrbHeader.Function == URB_FUNCTION_GET_STATUS_FROM_ENDPOINT)
+    {
+        //
+        // add interface type
+        //
+        CtrlSetup.bmRequestType.B |= 0x02;
+    }
 
     //
     // submit setup packet

Modified: trunk/reactos/lib/drivers/libusb/usb_device.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/usb_device.cpp?rev=56668&r1=56667&r2=56668&view=diff
==============================================================================
--- trunk/reactos/lib/drivers/libusb/usb_device.cpp [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/libusb/usb_device.cpp [iso-8859-1] Mon May 28 10:49:44 2012
@@ -380,7 +380,7 @@
     RtlZeroMemory(m_ConfigurationDescriptors, sizeof(USB_CONFIGURATION) * m_DeviceDescriptor.bNumConfigurations);
 
     // retrieve the configuration descriptors
-    for(Index = 0; Index < m_DeviceDescriptor.bNumConfigurations; Index++)
+    for (Index = 0; Index < m_DeviceDescriptor.bNumConfigurations; Index++)
     {
         // retrieve configuration descriptors from device
         Status = CreateConfigurationDescriptor(Index);
@@ -1029,7 +1029,7 @@
     if (ConfigurationDescriptor)
     {
         // find configuration index
-        for(Index = 0; Index < m_DeviceDescriptor.bNumConfigurations; Index++)
+        for (Index = 0; Index < m_DeviceDescriptor.bNumConfigurations; Index++)
         {
             if (m_ConfigurationDescriptors[Index].ConfigurationDescriptor->bConfigurationValue  == ConfigurationDescriptor->bConfigurationValue)
             {
@@ -1041,7 +1041,7 @@
 
         if (!Found)
         {
-            DPRINT1("[USBLIB] invalid configuration value %lu\n", ConfigurationDescriptor->bConfigurationValue);
+            DPRINT1("[USBLIB] invalid configuration value %u\n", ConfigurationDescriptor->bConfigurationValue);
             return STATUS_INVALID_PARAMETER;
         }
 
@@ -1063,13 +1063,13 @@
     if (!ConfigurationDescriptor)
     {
         // unconfigure request
-        DPRINT1("CUSBDevice::SelectConfiguration Unconfigure Request Status %x\n", Status);
+        DPRINT1("CUSBDevice::SelectConfiguration Unconfigure Request Status %lx\n", Status);
         m_ConfigurationIndex = 0;
         return Status;
     }
 
     // informal debug print
-    DPRINT1("CUSBDevice::SelectConfiguration New Configuration %x Old Configuration %x Result %x\n", ConfigurationIndex, m_ConfigurationIndex, Status);
+    DPRINT1("CUSBDevice::SelectConfiguration New Configuration %x Old Configuration %x Result %lx\n", ConfigurationIndex, m_ConfigurationIndex, Status);
     if (!NT_SUCCESS(Status))
     {
         //
@@ -1079,7 +1079,7 @@
     }
 
     // destroy old interface info
-    while(!IsListEmpty(&m_ConfigurationDescriptors[m_ConfigurationIndex].InterfaceList))
+    while (!IsListEmpty(&m_ConfigurationDescriptors[m_ConfigurationIndex].InterfaceList))
     {
         // remove entry
         Entry = RemoveHeadList(&m_ConfigurationDescriptors[m_ConfigurationIndex].InterfaceList);
@@ -1180,9 +1180,9 @@
     Status = CommitSetupPacket(&CtrlSetup, NULL, 0, NULL);
 
     // informal debug print
-    DPRINT1("CUSBDevice::SelectInterface AlternateSetting %x InterfaceNumber %x Status %x\n", InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber, Status);
+    DPRINT1("CUSBDevice::SelectInterface AlternateSetting %x InterfaceNumber %x Status %lx\n", InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber, Status);
 #if 0
-	if (!NT_SUCCESS(Status))
+    if (!NT_SUCCESS(Status))
     {
         // failed to select interface
         return Status;
@@ -1190,12 +1190,11 @@
 #endif
 
     Status = STATUS_SUCCESS;
-
 
     // find interface
     Found = FALSE;
     Entry = m_ConfigurationDescriptors[ConfigurationIndex].InterfaceList.Flink;
-    while(Entry != &m_ConfigurationDescriptors[ConfigurationIndex].InterfaceList)
+    while (Entry != &m_ConfigurationDescriptors[ConfigurationIndex].InterfaceList)
     {
         // grab interface descriptor
         UsbInterface = (PUSB_INTERFACE)CONTAINING_RECORD(Entry, USB_INTERFACE, ListEntry);
@@ -1241,7 +1240,7 @@
     InterfaceInfo->NumberOfPipes = UsbInterface->InterfaceDescriptor->bNumEndpoints;
 
     // copy pipe handles
-    for(PipeIndex = 0; PipeIndex < UsbInterface->InterfaceDescriptor->bNumEndpoints; PipeIndex++)
+    for (PipeIndex = 0; PipeIndex < UsbInterface->InterfaceDescriptor->bNumEndpoints; PipeIndex++)
     {
         // copy pipe handle
         DPRINT1("PipeIndex %lu\n", PipeIndex);
@@ -1250,7 +1249,7 @@
         DPRINT1("MaximumPacketSize %d\n", InterfaceInfo->Pipes[PipeIndex].MaximumPacketSize);
         DPRINT1("MaximumTransferSize %d\n", InterfaceInfo->Pipes[PipeIndex].MaximumTransferSize);
         DPRINT1("PipeFlags %d\n", InterfaceInfo->Pipes[PipeIndex].PipeFlags);
-        DPRINT1("PipeType %dd\n", InterfaceInfo->Pipes[PipeIndex].PipeType);
+        DPRINT1("PipeType %d\n", InterfaceInfo->Pipes[PipeIndex].PipeType);
         DPRINT1("UsbEndPoint %x\n", InterfaceInfo->Pipes[PipeIndex].EndpointAddress);
 
         // sanity checks
@@ -1264,7 +1263,6 @@
         UsbInterface->EndPoints[PipeIndex].DataToggle = FALSE;
     }
 
-
     //
     // done
     //




More information about the Ros-diffs mailing list