Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/nick-nhusb]: src/sys/dev/usb Reduce scope of variables



details:   https://anonhg.NetBSD.org/src/rev/39e810a69862
branches:  nick-nhusb
changeset: 334576:39e810a69862
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Dec 27 10:37:52 2016 +0000

description:
Reduce scope of variables

diffstat:

 sys/dev/usb/ehci.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (50 lines):

diff -r 9cf4c223d688 -r 39e810a69862 sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c        Tue Dec 27 10:24:00 2016 +0000
+++ b/sys/dev/usb/ehci.c        Tue Dec 27 10:37:52 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci.c,v 1.234.2.106 2016/12/27 10:16:49 skrll Exp $ */
+/*     $NetBSD: ehci.c,v 1.234.2.107 2016/12/27 10:37:52 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.106 2016/12/27 10:16:49 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.107 2016/12/27 10:37:52 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -3392,18 +3392,17 @@
 Static void
 ehci_timeout(void *addr)
 {
+       EHCIHIST_FUNC(); EHCIHIST_CALLED();
        struct usbd_xfer *xfer = addr;
-       struct usbd_pipe *pipe = xfer->ux_pipe;
-       struct usbd_device *dev = pipe->up_dev;
        ehci_softc_t *sc = EHCI_XFER2SC(xfer);
        bool timeout = false;
 
-       EHCIHIST_FUNC(); EHCIHIST_CALLED();
-
        DPRINTF("xfer %p", xfer, 0, 0, 0);
 #ifdef EHCI_DEBUG
-       if (ehcidebug >= 2)
+       if (ehcidebug >= 2) {
+               struct usbd_pipe *pipe = xfer->ux_pipe;
                usbd_dump_pipe(pipe);
+       }
 #endif
 
        mutex_enter(&sc->sc_lock);
@@ -3418,6 +3417,8 @@
        mutex_exit(&sc->sc_lock);
 
        if (timeout) {
+               struct usbd_device *dev = xfer->ux_pipe->up_dev;
+
                /* Execute the abort in a process context. */
                usb_init_task(&xfer->ux_aborttask, ehci_timeout_task, xfer,
                    USB_TASKQ_MPSAFE);



Home | Main Index | Thread Index | Old Index