Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Oct 2007 17:17:08 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 127066 for review
Message-ID:  <200710011717.l91HH8Bs011807@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=127066

Change 127066 by hselasky@hselasky_laptop001 on 2007/10/01 17:16:23

	
	Optimise;
	 1) No need to preset the "status" variable.
	 2) No need to compute last data toggle at every iteration.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/ehci.c#41 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/ehci.c#41 (text+ko) ====

@@ -1076,12 +1076,9 @@
 	ehci_qtd_t *td_alt_next;
 	uint32_t status;
 	uint16_t len;
-	uint8_t last_toggle;
 
 	td = xfer->td_transfer_cache;
 	td_alt_next = td->alt_next;
-	status = EHCI_QTD_HALTED;
-	last_toggle = 0;
 
 	while (1) {
 
@@ -1104,9 +1101,6 @@
 	        xfer->frlengths[xfer->aframes] -= len;
 	    }
 
-	    /* Make a copy of the data toggle */
-	    last_toggle = (status & EHCI_QTD_TOGGLE_MASK) ? 1 : 0;
-
 	    /* Check for last transfer */
 	    if (((void *)td) == xfer->td_transfer_last) {
 	        if (len == 0) {
@@ -1153,7 +1147,8 @@
 
 	/* update data toggle */
 
-	xfer->pipe->toggle_next = last_toggle;
+	xfer->pipe->toggle_next =
+	  (status & EHCI_QTD_TOGGLE_MASK) ? 1 : 0;
 
 #ifdef USB_DEBUG
 	if (status & EHCI_QTD_STATERRS) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710011717.l91HH8Bs011807>