PERFORCE change 165195 for review
Sylvestre Gallon
syl at FreeBSD.org
Thu Jun 25 19:10:19 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=165195
Change 165195 by syl at 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);
More information about the p4-projects
mailing list