Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Why KASSERT when you can KASSERTMSG



details:   https://anonhg.NetBSD.org/src/rev/fca1c741a846
branches:  trunk
changeset: 813808:fca1c741a846
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Feb 19 21:41:59 2016 +0000

description:
Why KASSERT when you can KASSERTMSG

diffstat:

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

diffs (28 lines):

diff -r c30dc6934354 -r fca1c741a846 sys/dev/usb/usb_mem.c
--- a/sys/dev/usb/usb_mem.c     Fri Feb 19 21:10:18 2016 +0000
+++ b/sys/dev/usb/usb_mem.c     Fri Feb 19 21:41:59 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_mem.c,v 1.65 2014/09/12 16:40:38 skrll Exp $       */
+/*     $NetBSD: usb_mem.c,v 1.66 2016/02/19 21:41:59 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.65 2014/09/12 16:40:38 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.66 2016/02/19 21:41:59 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -400,7 +400,8 @@
 
        offset += dma->offs;
 
-       KASSERT(offset < dma->block->size);
+       KASSERTMSG(offset < dma->block->size, "offset %d vs %zu", offset,
+           dma->block->size);
 
        if (dma->block->nsegs == 1) {
                KASSERT(dma->block->map->dm_segs[0].ds_len > offset);



Home | Main Index | Thread Index | Old Index