svn commit: r219930 - head/sys/dev/usb/controller

Hans Petter Selasky hselasky at FreeBSD.org
Wed Mar 23 19:41:45 UTC 2011


Author: hselasky
Date: Wed Mar 23 19:41:44 2011
New Revision: 219930
URL: http://svn.freebsd.org/changeset/base/219930

Log:
  Comply with style(9).
  
  Reported by:	gavin
  MFC after:	14 days
  Approved by:	thompsa (mentor)

Modified:
  head/sys/dev/usb/controller/ehci.c

Modified: head/sys/dev/usb/controller/ehci.c
==============================================================================
--- head/sys/dev/usb/controller/ehci.c	Wed Mar 23 19:30:47 2011	(r219929)
+++ head/sys/dev/usb/controller/ehci.c	Wed Mar 23 19:41:44 2011	(r219930)
@@ -1183,18 +1183,18 @@ _ehci_remove_qh(ehci_qh_t *sqh, ehci_qh_
 static void
 ehci_data_toggle_update(struct usb_xfer *xfer, uint16_t actlen, uint16_t xlen)
 {
-	uint8_t full = (actlen == xlen);
+	uint16_t rem;
 	uint8_t dt;
 
 	/* count number of full packets */
 	dt = (actlen / xfer->max_packet_size) & 1;
 
 	/* cumpute remainder */
-	actlen = actlen % xfer->max_packet_size;
+	rem = actlen % xfer->max_packet_size;
 
-	if (actlen > 0)
+	if (rem > 0)
 		dt ^= 1;	/* short packet at the end */
-	else if (!full)
+	else if (actlen != xlen)
 		dt ^= 1;	/* zero length packet at the end */
 
 	xfer->endpoint->toggle_next ^= dt;


More information about the svn-src-all mailing list