Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Convert to kmem



details:   https://anonhg.NetBSD.org/src/rev/72089040bfac
branches:  trunk
changeset: 839124:72089040bfac
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Feb 07 13:48:27 2019 +0000

description:
Convert to kmem

diffstat:

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

diffs (116 lines):

diff -r 52efa5635d70 -r 72089040bfac sys/dev/usb/umass.c
--- a/sys/dev/usb/umass.c       Thu Feb 07 13:43:44 2019 +0000
+++ b/sys/dev/usb/umass.c       Thu Feb 07 13:48:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umass.c,v 1.172 2019/02/07 13:43:44 skrll Exp $        */
+/*     $NetBSD: umass.c,v 1.173 2019/02/07 13:48:27 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.172 2019/02/07 13:43:44 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.173 2019/02/07 13:48:27 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -139,7 +139,7 @@
 #include <sys/conf.h>
 #include <sys/device.h>
 #include <sys/kernel.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/sysctl.h>
 #include <sys/systm.h>
 
@@ -841,7 +841,7 @@
                        break;
                }
 
-               free(scbus, M_DEVBUF);
+               kmem_free(scbus, sizeof(*scbus));
                sc->bus = NULL;
        }
 
diff -r 52efa5635d70 -r 72089040bfac sys/dev/usb/umass_isdata.c
--- a/sys/dev/usb/umass_isdata.c        Thu Feb 07 13:43:44 2019 +0000
+++ b/sys/dev/usb/umass_isdata.c        Thu Feb 07 13:48:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umass_isdata.c,v 1.40 2019/01/22 06:46:21 skrll Exp $  */
+/*     $NetBSD: umass_isdata.c,v 1.41 2019/02/07 13:48:27 skrll Exp $  */
 
 /*
  * TODO:
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass_isdata.c,v 1.40 2019/01/22 06:46:21 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass_isdata.c,v 1.41 2019/02/07 13:48:27 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -49,7 +49,7 @@
 #include <sys/device.h>
 #include <sys/disklabel.h>
 #include <sys/kernel.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/proc.h>
 #include <sys/systm.h>
 
@@ -196,7 +196,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;
 
@@ -209,7 +209,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 52efa5635d70 -r 72089040bfac sys/dev/usb/umass_scsipi.c
--- a/sys/dev/usb/umass_scsipi.c        Thu Feb 07 13:43:44 2019 +0000
+++ b/sys/dev/usb/umass_scsipi.c        Thu Feb 07 13:48:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umass_scsipi.c,v 1.58 2019/02/07 13:20:41 skrll Exp $  */
+/*     $NetBSD: umass_scsipi.c,v 1.59 2019/02/07 13:48:27 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.58 2019/02/07 13:20:41 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.59 2019/02/07 13:48:27 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -48,6 +48,7 @@
 #include <sys/disk.h>          /* XXX */
 #include <sys/ioctl.h>
 #include <sys/kernel.h>
+#include <sys/kmem.h>
 #include <sys/lwp.h>
 #include <sys/malloc.h>
 #include <sys/systm.h>
@@ -189,7 +190,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