Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Move the zeroing of the xfer to the individual m...



details:   https://anonhg.NetBSD.org/src/rev/152f0cd36a29
branches:  trunk
changeset: 480729:152f0cd36a29
user:      augustss <augustss%NetBSD.org@localhost>
date:      Tue Jan 18 20:23:42 2000 +0000

description:
Move the zeroing of the xfer to the individual methods.

diffstat:

 sys/dev/usb/ohci.c  |  4 +++-
 sys/dev/usb/uhci.c  |  4 +++-
 sys/dev/usb/usbdi.c |  3 +--
 3 files changed, 7 insertions(+), 4 deletions(-)

diffs (53 lines):

diff -r 2a2949ed1dca -r 152f0cd36a29 sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Tue Jan 18 20:11:00 2000 +0000
+++ b/sys/dev/usb/ohci.c        Tue Jan 18 20:23:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.62 2000/01/18 20:11:00 augustss Exp $       */
+/*     $NetBSD: ohci.c,v 1.63 2000/01/18 20:23:42 augustss Exp $       */
 /*     $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $       */
 
 /*
@@ -838,6 +838,8 @@
                SIMPLEQ_REMOVE_HEAD(&sc->sc_free_xfers, xfer, next);
        else
                xfer = malloc(sizeof(*xfer), M_USB, M_NOWAIT);
+       if (xfer != NULL)
+               memset(xfer, 0, sizeof *xfer);
        return (xfer);
 }
 
diff -r 2a2949ed1dca -r 152f0cd36a29 sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c        Tue Jan 18 20:11:00 2000 +0000
+++ b/sys/dev/usb/uhci.c        Tue Jan 18 20:23:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci.c,v 1.76 2000/01/18 20:11:00 augustss Exp $       */
+/*     $NetBSD: uhci.c,v 1.77 2000/01/18 20:23:42 augustss Exp $       */
 /*     $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $       */
 
 /*
@@ -526,6 +526,8 @@
                SIMPLEQ_REMOVE_HEAD(&sc->sc_free_xfers, xfer, next);
        else
                xfer = malloc(sizeof(*xfer), M_USB, M_NOWAIT);
+       if (xfer != NULL)
+               memset(xfer, 0, sizeof *xfer);
        return (xfer);
 }
 
diff -r 2a2949ed1dca -r 152f0cd36a29 sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c       Tue Jan 18 20:11:00 2000 +0000
+++ b/sys/dev/usb/usbdi.c       Tue Jan 18 20:23:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi.c,v 1.58 2000/01/18 20:11:01 augustss Exp $      */
+/*     $NetBSD: usbdi.c,v 1.59 2000/01/18 20:23:42 augustss Exp $      */
 /*     $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $      */
 
 /*
@@ -366,7 +366,6 @@
        xfer = dev->bus->methods->allocx(dev->bus);
        if (xfer == NULL)
                return (NULL);
-       memset(xfer, 0, sizeof *xfer);
        xfer->device = dev;
        DPRINTFN(5,("usbd_alloc_xfer() = %p\n", xfer));
        return (xfer);



Home | Main Index | Thread Index | Old Index