From owner-p4-projects@FreeBSD.ORG Thu Jun 25 19:10:18 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E55EE1065674; Thu, 25 Jun 2009 19:10:17 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1B251065672 for ; Thu, 25 Jun 2009 19:10:17 +0000 (UTC) (envelope-from syl@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 9017C8FC1E for ; Thu, 25 Jun 2009 19:10:17 +0000 (UTC) (envelope-from syl@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n5PJAHGu071885 for ; Thu, 25 Jun 2009 19:10:17 GMT (envelope-from syl@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5PJAH2s071883 for perforce@freebsd.org; Thu, 25 Jun 2009 19:10:17 GMT (envelope-from syl@FreeBSD.org) Date: Thu, 25 Jun 2009 19:10:17 GMT Message-Id: <200906251910.n5PJAH2s071883@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to syl@FreeBSD.org using -f From: Sylvestre Gallon To: Perforce Change Reviews Cc: Subject: PERFORCE change 165195 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2009 19:10:19 -0000 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);