From owner-p4-projects@FreeBSD.ORG Thu Nov 22 20:00:28 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 70A1816A468; Thu, 22 Nov 2007 20:00:28 +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 1A4BA16A417 for ; Thu, 22 Nov 2007 20:00:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1F4AB13C458 for ; Thu, 22 Nov 2007 20:00:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lAMK0Q4i061853 for ; Thu, 22 Nov 2007 20:00:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lAMK0QOJ061850 for perforce@freebsd.org; Thu, 22 Nov 2007 20:00:26 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 22 Nov 2007 20:00:26 GMT Message-Id: <200711222000.lAMK0QOJ061850@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 129389 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, 22 Nov 2007 20:00:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=129389 Change 129389 by hselasky@hselasky_laptop001 on 2007/11/22 20:00:04 Style code by running "usb_style.sh". Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#44 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#44 (text+ko) ==== @@ -1264,75 +1264,74 @@ if (!xfer->flags_int.open) { return; } + /* set "transferring" and "recursed_2" flags */ + xfer->flags_int.transferring = 1; + xfer->flags_int.recursed_2 = 1; - /* set "transferring" and "recursed_2" flags */ - xfer->flags_int.transferring = 1; - xfer->flags_int.recursed_2 = 1; + /* clear lengths and frame counts by default */ + xfer->sumlen = 0; + xfer->actlen = 0; + xfer->aframes = 0; - /* clear lengths and frame counts by default */ - xfer->sumlen = 0; - xfer->actlen = 0; - xfer->aframes = 0; + /* sanity check */ - /* sanity check */ + if (xfer->nframes == 0) { + usbd_premature_callback(xfer, USBD_INVAL); + return; + } + /* compute total transfer length */ - if (xfer->nframes == 0) { + for (x = 0; x != xfer->nframes; x++) { + xfer->sumlen += xfer->frlengths[x]; + if (xfer->sumlen < xfer->frlengths[x]) { + /* length wrapped around */ usbd_premature_callback(xfer, USBD_INVAL); return; } - /* compute total transfer length */ + } - for (x = 0; x != xfer->nframes; x++) { - xfer->sumlen += xfer->frlengths[x]; - if (xfer->sumlen < xfer->frlengths[x]) { - /* length wrapped around */ - usbd_premature_callback(xfer, USBD_INVAL); - return; - } - } + /* filter some flags */ - /* filter some flags */ + xfer->flags_int.short_xfer_ok = 0; + xfer->flags_int.short_frames_ok = 0; - xfer->flags_int.short_xfer_ok = 0; - xfer->flags_int.short_frames_ok = 0; + /* check if this is a control transfer */ - /* check if this is a control transfer */ + if (xfer->flags_int.control_xfr) { - if (xfer->flags_int.control_xfr) { - - if (usbd_start_hardware_sub(xfer)) { - usbd_premature_callback(xfer, USBD_STALLED); - return; + if (usbd_start_hardware_sub(xfer)) { + usbd_premature_callback(xfer, USBD_STALLED); + return; + } + if (xfer->endpoint & UE_DIR_IN) { + if (xfer->flags.short_xfer_ok) { + xfer->flags_int.short_xfer_ok = 1; } - if (xfer->endpoint & UE_DIR_IN) { - if (xfer->flags.short_xfer_ok) { - xfer->flags_int.short_xfer_ok = 1; - } - } - } else { + } + } else { - if (xfer->endpoint & UE_DIR_IN) { - if (xfer->flags.short_frames_ok) { - xfer->flags_int.short_xfer_ok = 1; - xfer->flags_int.short_frames_ok = 1; - } else if (xfer->flags.short_xfer_ok) { - xfer->flags_int.short_xfer_ok = 1; - } + if (xfer->endpoint & UE_DIR_IN) { + if (xfer->flags.short_frames_ok) { + xfer->flags_int.short_xfer_ok = 1; + xfer->flags_int.short_frames_ok = 1; + } else if (xfer->flags.short_xfer_ok) { + xfer->flags_int.short_xfer_ok = 1; } } + } - mtx_lock(xfer->usb_mtx); + mtx_lock(xfer->usb_mtx); - /* - * Setup "usb_thread" - */ - xfer->usb_thread = (xfer->flags.use_polling) ? - curthread : NULL; + /* + * Setup "usb_thread" + */ + xfer->usb_thread = (xfer->flags.use_polling) ? + curthread : NULL; - /* enter the transfer */ - (xfer->pipe->methods->enter) (xfer); + /* enter the transfer */ + (xfer->pipe->methods->enter) (xfer); - mtx_unlock(xfer->usb_mtx); + mtx_unlock(xfer->usb_mtx); return; }