USB: ehci saves some memory in ISO transfer descriptors
authorKarsten Wiese <fzu@wemgehoertderstaat.de>
Mon, 31 Dec 2007 05:55:05 +0000 (21:55 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Feb 2008 22:35:02 +0000 (14:35 -0800)
In the EHCI driver, itd->usecs[8] is used in periodic_usecs(), indexed by
uframe.  For an ITD's unused uframes it is 0, else it contains the same
value as itd->stream->usecs.  To check if an ITD's uframe is used, we can
instead test itd->hw_transaction[uframe]:  if used, it will be nonzero no
matter what endianess is used.

This patch replaces those two uses, eliminates itd->usecs[], and saves
eight bytes from each ITD.

Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/ehci-sched.c
drivers/usb/host/ehci.h

index 1c771045ccaa8e3e7bfc2ca08e56a87944c9b4de..1a94e6cec4190c2dd434d884dee083d452e9ad82 100644 (file)
@@ -119,7 +119,8 @@ periodic_usecs (struct ehci_hcd *ehci, unsigned frame, unsigned uframe)
                        q = &q->fstn->fstn_next;
                        break;
                case Q_TYPE_ITD:
-                       usecs += q->itd->usecs [uframe];
+                       if (q->itd->hw_transaction[uframe])
+                               usecs += q->itd->stream->usecs;
                        hw_p = &q->itd->hw_next;
                        q = &q->itd->itd_next;
                        break;
@@ -1536,7 +1537,6 @@ itd_link_urb (
                uframe = next_uframe & 0x07;
                frame = next_uframe >> 3;
 
-               itd->usecs [uframe] = stream->usecs;
                itd_patch(ehci, itd, iso_sched, packet, uframe);
 
                next_uframe += stream->interval;
index f83472856a80dc593d2fd22bfb87a6dae580b418..42969e9d8c447d05a93b110486ee00123da236ee 100644 (file)
@@ -602,7 +602,6 @@ struct ehci_itd {
        unsigned                frame;          /* where scheduled */
        unsigned                pg;
        unsigned                index[8];       /* in urb->iso_frame_desc */
-       u8                      usecs[8];
 } __attribute__ ((aligned (32)));
 
 /*-------------------------------------------------------------------------*/