Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Replace home grown #ifdef DIAGNOSTIC check with ...



details:   https://anonhg.NetBSD.org/src/rev/c6710a766d36
branches:  trunk
changeset: 979674:c6710a766d36
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Jan 05 16:15:09 2021 +0000

description:
Replace home grown #ifdef DIAGNOSTIC check with ASSERT_SLEEPABLE

diffstat:

 sys/dev/usb/usb_mem.c |  12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diffs (33 lines):

diff -r c696e9e216d9 -r c6710a766d36 sys/dev/usb/usb_mem.c
--- a/sys/dev/usb/usb_mem.c     Tue Jan 05 11:07:59 2021 +0000
+++ b/sys/dev/usb/usb_mem.c     Tue Jan 05 16:15:09 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_mem.c,v 1.78 2021/01/02 12:39:03 jmcneill Exp $    */
+/*     $NetBSD: usb_mem.c,v 1.79 2021/01/05 16:15:09 skrll Exp $       */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.78 2021/01/02 12:39:03 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.79 2021/01/05 16:15:09 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -211,12 +211,8 @@
 void
 usb_block_real_freemem(usb_dma_block_t *b)
 {
-#ifdef DIAGNOSTIC
-       if (cpu_softintr_p() || cpu_intr_p()) {
-               printf("usb_block_real_freemem: in interrupt context\n");
-               return;
-       }
-#endif
+       ASSERT_SLEEPABLE();
+
        bus_dmamap_unload(b->tag, b->map);
        bus_dmamap_destroy(b->tag, b->map);
        bus_dmamem_unmap(b->tag, b->kaddr, b->size);



Home | Main Index | Thread Index | Old Index