[PATCH 3/3] ehci-hcd: slimm struct ehci_itd by removing usecs[8]

Karsten Wiese <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
usecs[] was used in periodic_usecs(), indexed by uframe.
For an ITD's unused uframes it was 0, else it contained the value of
itd->stream->usecs.
To check if an ITD's uframe is used, we can also test
itd->hw_transaction[uframe]: It contains != 0 no matter what endianess
itd->hw_transaction[]'s type is for used uframes.
Replace the access to usecs[uframe] in periodic_usecs() by an access to
itd->stream->usecs for used uframes. Else don't add to periodic_usecs()'s
result.
Saves 8bytes, makes struct ehci_itd use 160 Bytes on x86_64, if
"ehci-hcd: complete ISO URBs sooner" and
"ehci-hcd: slimm struct ehci_itd" were applied before ontop of 2.6.24-rc2.

Signed-off-by: Karsten Wiese <[email protected]>
---
 drivers/usb/host/ehci-sched.c |    4 ++--
 drivers/usb/host/ehci.h       |    1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 38a7901..c41d348 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -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;
@@ -1530,7 +1531,6 @@ itd_link_urb (
 
 		frame = next_uframe >> 3;
 
-		itd->usecs [uframe] = stream->usecs;
 		itd_patch(ehci, itd, iso_sched, packet, uframe);
 
 		next_uframe += stream->interval;
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 135dfae..2ec0bae 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -589,7 +589,6 @@ struct ehci_itd {
 	/* any/all hw_transactions here may be used by that urb */
 	unsigned		frame;		/* where scheduled */
 	unsigned		pg;
-	u8			usecs[8];
 } __attribute__ ((aligned (32)));
 
 /*-------------------------------------------------------------------------*/
-- 
1.5.3.3


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.