Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jun 2009 19:10:17 GMT
From:      Sylvestre Gallon <syl@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 165195 for review
Message-ID:  <200906251910.n5PJAH2s071883@repoman.freebsd.org>

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

Change 165195 by syl@syl_atuin on 2009/06/25 19:10:06

	Remove useless and buggy GET_XFER macro. 
	(on Hans Petter Selasky advices).

Affected files ...

.. //depot/projects/soc2009/syl_usb/src/lib/libusb/libusb10.c#45 edit
.. //depot/projects/soc2009/syl_usb/src/lib/libusb/libusb10.h#10 edit

Differences ...

==== //depot/projects/soc2009/syl_usb/src/lib/libusb/libusb10.c#45 (text+ko) ====

@@ -660,14 +660,19 @@
 libusb_clear_halt(libusb_device_handle * devh, unsigned char endpoint)
 {
 	struct libusb20_transfer *xfer;
+	struct libusb20_device *pdev;
 	libusb_context *ctx;
 	int ret; 
 
 	ctx = NULL;
 	GET_CONTEXT(ctx);
 	dprintf(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_clear_halt enter");
-
-	GET_XFER(xfer, endpoint, devh->os_priv);
+	
+	pdev = devh->os_priv;
+	xfer = libusb20_tr_get_pointer(pdev, 
+	    ((endpoint / 0x40) | (endpoint * 4)) % (16 * 4));
+	if (xfer == NULL)
+		return (LIBUSB_ERROR_NO_MEM);
 
 	pthread_mutex_lock(&libusb20_lock);
 	ret = libusb20_tr_open(xfer, 0, 0, endpoint);

==== //depot/projects/soc2009/syl_usb/src/lib/libusb/libusb10.h#10 (text+ko) ====

@@ -61,14 +61,6 @@
 	    &pos->member != (head); \
 	    pos = n, n = LIST_ENT(n->member.next, typeof(*n), member))	
 
-/* fetch libusb20_transfer from libusb20_device */
-#define GET_XFER(xfer, endpoint, pdev)\
-	xfer = libusb20_tr_get_pointer(pdev, \
-	    (2 *endpoint)|(endpoint/0x80)); \
-	if (xfer == NULL) \
-		return (LIBUSB_ERROR_OTHER);
-
-
 static int get_next_timeout(libusb_context *ctx, struct timeval *tv, struct timeval *out);
 static int handle_timeouts(struct libusb_context *ctx);
 static int handle_events(struct libusb_context *ctx, struct timeval *tv);



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