[USBPORT]
authorThomas Faber <thomas.faber@reactos.org>
Sat, 2 Sep 2017 09:03:07 +0000 (09:03 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sat, 2 Sep 2017 09:03:07 +0000 (09:03 +0000)
- Avoid unnecessary duplicate variables in USBPORT_FlushPendingTransfers

svn path=/trunk/; revision=75737

reactos/drivers/usb/usbport/queue.c

index 75f2f45..72cf4f5 100644 (file)
@@ -759,10 +759,8 @@ USBPORT_FlushPendingTransfers(IN PUSBPORT_ENDPOINT Endpoint)
     BOOLEAN IsEnd = FALSE;
     PLIST_ENTRY List;
     PUSBPORT_TRANSFER Transfer;
-    KIRQL PrevIrql;
     PURB Urb;
     PIRP Irp;
-    PIRP irp;
     KIRQL OldIrql;
     BOOLEAN Result;
 
@@ -877,11 +875,9 @@ USBPORT_FlushPendingTransfers(IN PUSBPORT_ENDPOINT Endpoint)
         Transfer->TransferLink.Flink = NULL;
         Transfer->TransferLink.Blink = NULL;
 
-        irp = Irp;
-
         if (Irp)
         {
-            irp = USBPORT_RemovePendingTransferIrp(FdoDevice, Irp);
+            Irp = USBPORT_RemovePendingTransferIrp(FdoDevice, Irp);
         }
 
         KeReleaseSpinLockFromDpcLevel(&Endpoint->EndpointSpinLock);
@@ -890,13 +886,13 @@ USBPORT_FlushPendingTransfers(IN PUSBPORT_ENDPOINT Endpoint)
 
         KeAcquireSpinLock(&FdoExtension->FlushTransferSpinLock, &OldIrql);
 
-        if (irp)
+        if (Irp)
         {
-            IoSetCancelRoutine(irp, USBPORT_CancelActiveTransferIrp);
+            IoSetCancelRoutine(Irp, USBPORT_CancelActiveTransferIrp);
 
-            if (Irp->Cancel && IoSetCancelRoutine(irp, NULL))
+            if (Irp->Cancel && IoSetCancelRoutine(Irp, NULL))
             {
-                DPRINT_CORE("USBPORT_FlushPendingTransfers: irp - %p\n", irp);
+                DPRINT_CORE("USBPORT_FlushPendingTransfers: irp - %p\n", Irp);
 
                 KeReleaseSpinLock(&FdoExtension->FlushTransferSpinLock,
                                   OldIrql);
@@ -905,8 +901,8 @@ USBPORT_FlushPendingTransfers(IN PUSBPORT_ENDPOINT Endpoint)
                 goto Worker;
             }
 
-            USBPORT_FindUrbInIrpTable(FdoExtension->ActiveIrpTable, Urb, irp);
-            USBPORT_InsertIrpInTable(FdoExtension->ActiveIrpTable, irp);
+            USBPORT_FindUrbInIrpTable(FdoExtension->ActiveIrpTable, Urb, Irp);
+            USBPORT_InsertIrpInTable(FdoExtension->ActiveIrpTable, Irp);
         }
 
         IsMapTransfer = USBPORT_QueueActiveUrbToEndpoint(Endpoint, Urb);
@@ -920,9 +916,9 @@ USBPORT_FlushPendingTransfers(IN PUSBPORT_ENDPOINT Endpoint)
         }
 
 Worker:
-        KeRaiseIrql(DISPATCH_LEVEL, &PrevIrql);
+        KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
         Result = USBPORT_EndpointWorker(Endpoint, FALSE);
-        KeLowerIrql(PrevIrql);
+        KeLowerIrql(OldIrql);
 
         if (Result)
             USBPORT_InvalidateEndpointHandler(FdoDevice,