Add Null_TP constant
authorAdrian-Ken Rueegsegger <ken@codelabs.ch>
Wed, 18 Oct 2017 12:24:45 +0000 (14:24 +0200)
committerAdrian-Ken Rueegsegger <ken@codelabs.ch>
Fri, 27 Oct 2017 10:43:12 +0000 (12:43 +0200)
Use it to initialize transfer pointers.

Signed-off-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
src/hw-dbc-transfer_rings.adb

index 921b21a577af283567570fa92ec98c656556e52e..8f6f657feb24c1bee02b0c837085c9f9fd68f65d 100644 (file)
@@ -47,6 +47,13 @@ is
       Toggle   : TRBs.Ring_Range;
       Overrun  : Boolean;
    end record;
       Toggle   : TRBs.Ring_Range;
       Overrun  : Boolean;
    end record;
+   Null_TP : constant Transfer_Pointers
+     := (Enqueue => TRBs.Ring_Range'First,
+         Dequeue => TRBs.Ring_Range'First,
+         Full    => False,
+         Toggle  => TRBs.Ring_Range'First,
+         Overrun => False);
+
    type Transfer_Pointers_Array is array (Endpoint_Range) of Transfer_Pointers;
    Pointers : Transfer_Pointers_Array;
 
    type Transfer_Pointers_Array is array (Endpoint_Range) of Transfer_Pointers;
    Pointers : Transfer_Pointers_Array;
 
@@ -99,13 +106,8 @@ is
         (Physical => Physical (EP),
          Ring     => Rings (EP));
 
         (Physical => Physical (EP),
          Ring     => Rings (EP));
 
-      PCS (EP)       := 1;
-      Pointers (EP)  := Transfer_Pointers'
-        (Enqueue => TRBs.Ring_Range'First,
-         Dequeue => TRBs.Ring_Range'First,
-         Full    => False,
-         Toggle  => TRBs.Ring_Range'First,
-         Overrun => False);
+      PCS (EP)      := 1;
+      Pointers (EP) := Null_TP;
    end Initialize;
 
    ----------------------------------------------------------------------------
    end Initialize;
 
    ----------------------------------------------------------------------------