Source-Changes-HG archive

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

[src/trunk]: src/sys/kern #ifdef DIAGNOSTIC panic -> KASSERT



details:   https://anonhg.NetBSD.org/src/rev/6fdcc59953c7
branches:  trunk
changeset: 337626:6fdcc59953c7
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Apr 21 13:17:25 2015 +0000

description:
#ifdef DIAGNOSTIC panic -> KASSERT

diffstat:

 sys/kern/subr_copy.c |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (30 lines):

diff -r 18b0480c7290 -r 6fdcc59953c7 sys/kern/subr_copy.c
--- a/sys/kern/subr_copy.c      Tue Apr 21 13:15:28 2015 +0000
+++ b/sys/kern/subr_copy.c      Tue Apr 21 13:17:25 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_copy.c,v 1.5 2015/03/29 17:38:31 riastradh Exp $  */
+/*     $NetBSD: subr_copy.c,v 1.6 2015/04/21 13:17:25 riastradh Exp $  */
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_copy.c,v 1.5 2015/03/29 17:38:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_copy.c,v 1.6 2015/04/21 13:17:25 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/fcntl.h>
@@ -106,10 +106,7 @@
 
        ASSERT_SLEEPABLE();
 
-#ifdef DIAGNOSTIC
-       if (uio->uio_rw != UIO_READ && uio->uio_rw != UIO_WRITE)
-               panic("uiomove: mode");
-#endif
+       KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE);
        while (n > 0 && uio->uio_resid) {
                iov = uio->uio_iov;
                cnt = iov->iov_len;



Home | Main Index | Thread Index | Old Index