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 Convert to kmem(9)



details:   https://anonhg.NetBSD.org/src/rev/b96a8e28c33a
branches:  nick-nhusb
changeset: 334617:b96a8e28c33a
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Jan 29 10:10:30 2017 +0000

description:
Convert to kmem(9)

diffstat:

 sys/dev/usb/umass.c        |   7 +++----
 sys/dev/usb/umass_isdata.c |  10 +++++-----
 sys/dev/usb/umass_scsipi.c |   7 +++----
 3 files changed, 11 insertions(+), 13 deletions(-)

diffs (115 lines):

diff -r f7b94ee0ae19 -r b96a8e28c33a sys/dev/usb/umass.c
--- a/sys/dev/usb/umass.c       Sun Jan 29 10:08:38 2017 +0000
+++ b/sys/dev/usb/umass.c       Sun Jan 29 10:10:30 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umass.c,v 1.149.2.17 2017/01/29 10:08:38 skrll Exp $   */
+/*     $NetBSD: umass.c,v 1.149.2.18 2017/01/29 10:10:30 skrll Exp $   */
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.149.2.17 2017/01/29 10:08:38 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.149.2.18 2017/01/29 10:10:30 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -140,7 +140,6 @@
 #include <sys/conf.h>
 #include <sys/buf.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
 #include <sys/sysctl.h>
 
 #include <dev/usb/usb.h>
@@ -822,7 +821,7 @@
        if (scbus != NULL) {
                if (scbus->sc_child != NULL)
                        rv = config_detach(scbus->sc_child, flags);
-               free(scbus, M_DEVBUF);
+               kmem_free(scbus, sizeof(*scbus));
                sc->bus = NULL;
        }
 
diff -r f7b94ee0ae19 -r b96a8e28c33a sys/dev/usb/umass_isdata.c
--- a/sys/dev/usb/umass_isdata.c        Sun Jan 29 10:08:38 2017 +0000
+++ b/sys/dev/usb/umass_isdata.c        Sun Jan 29 10:10:30 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umass_isdata.c,v 1.30.2.6 2016/12/05 10:55:18 skrll Exp $      */
+/*     $NetBSD: umass_isdata.c,v 1.30.2.7 2017/01/29 10:10:30 skrll Exp $      */
 
 /*
  * TODO:
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass_isdata.c,v 1.30.2.6 2016/12/05 10:55:18 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass_isdata.c,v 1.30.2.7 2017/01/29 10:10:30 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -51,7 +51,7 @@
 #include <sys/device.h>
 #include <sys/proc.h>
 #include <sys/disklabel.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 
 #include <dev/usb/usb.h>
 #include <dev/usb/usbdi.h>
@@ -188,7 +188,7 @@
        struct uisdata_softc *scbus;
        struct isd200_config *cf;
 
-       scbus = malloc(sizeof(*scbus), M_DEVBUF, M_WAITOK | M_ZERO);
+       scbus = kmem_zalloc(sizeof(*scbus), KM_SLEEP);
        sc->bus = &scbus->base;
        cf = &scbus->sc_isd_config;
 
@@ -201,7 +201,7 @@
        err = usbd_do_request(sc->sc_udev, &req, cf);
        if (err) {
                sc->bus = NULL;
-               free(scbus, M_DEVBUF);
+               kmem_free(scbus, sizeof(*scbus));
                return EIO;
        }
        DPRINTF(("umass_wd_attach info:\n  EventNotification=0x%02x "
diff -r f7b94ee0ae19 -r b96a8e28c33a sys/dev/usb/umass_scsipi.c
--- a/sys/dev/usb/umass_scsipi.c        Sun Jan 29 10:08:38 2017 +0000
+++ b/sys/dev/usb/umass_scsipi.c        Sun Jan 29 10:10:30 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umass_scsipi.c,v 1.49.2.6 2016/12/05 10:55:18 skrll Exp $      */
+/*     $NetBSD: umass_scsipi.c,v 1.49.2.7 2017/01/29 10:10:30 skrll Exp $      */
 
 /*
  * Copyright (c) 2001, 2003, 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.49.2.6 2016/12/05 10:55:18 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.49.2.7 2017/01/29 10:10:30 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -49,7 +49,6 @@
 #include <sys/device.h>
 #include <sys/ioctl.h>
 #include <sys/lwp.h>
-#include <sys/malloc.h>
 
 /* SCSI & ATAPI */
 #include <sys/scsiio.h>
@@ -180,7 +179,7 @@
 {
        struct umass_scsipi_softc *scbus;
 
-       scbus = malloc(sizeof(*scbus), M_DEVBUF, M_WAITOK | M_ZERO);
+       scbus = kmem_zalloc(sizeof(*scbus), KM_SLEEP);
        sc->bus = &scbus->base;
 
        /* Only use big commands for USB SCSI devices. */



Home | Main Index | Thread Index | Old Index