Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Sep 2007 15:18:13 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 126740 for review
Message-ID:  <200709231518.l8NFIDmx091369@repoman.freebsd.org>

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

Change 126740 by hselasky@hselasky_laptop001 on 2007/09/23 15:17:12

	
	FYI; The comments follow the P4 diff from top to bottom.
	
	- we now need "sys/sx.h" included by default.
	
	- update "USBD_CHECK_STATUS()" macro to use the bit-field
	  version instead of the masked version of USBD_XXX flags.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/usb_port.h#16 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/usb_port.h#16 (text+ko) ====

@@ -60,6 +60,7 @@
 #   include <sys/lockmgr.h>
 #   include <sys/module.h>
 #   include <sys/mutex.h>
+#   include <sys/sx.h>
 #   include <sys/rman.h> 
 #   include <sys/selinfo.h>
 #   include <sys/sysctl.h> /* SYSCTL_XXX() */
@@ -233,18 +234,12 @@
 #define PRINTFN(n,x)
 #endif
 
-#define USBD_CHECK_STATUS(xfer)			\
-{ if((xfer)->flags & USBD_DEV_TRANSFERRING)	\
-  {						\
-     (xfer)->flags &= ~USBD_DEV_TRANSFERRING;	\
-     if( (xfer)->error )			\
-     { goto tr_error; }				\
-     else					\
-     { goto tr_transferred; }			\
-  }						\
-  else						\
-  { goto tr_setup; }				\
-}						\
+#define USBD_CHECK_STATUS(xfer)	do {			\
+    if (!(xfer)->flags_int.transferring) goto tr_setup;	\
+    (xfer)->flags_int.transferring = 0;			\
+    if ((xfer)->error) goto tr_error;			\
+    goto tr_transferred;				\
+} while (0)
 /**/
 
 #define _MAKE_ENUM(enum,value,arg...)		\



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