From a6d56fa756ec398d3c83eb807e71333e416970cc Mon Sep 17 00:00:00 2001 From: riastradh Date: Tue, 21 Apr 2015 13:17:25 +0000 Subject: [PATCH] #ifdef DIAGNOSTIC panic -> KASSERT --- sys/kern/subr_copy.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/kern/subr_copy.c b/sys/kern/subr_copy.c index bdd3a834c75f..7ce89689b6ed 100644 --- a/sys/kern/subr_copy.c +++ b/sys/kern/subr_copy.c @@ -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 -__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 #include @@ -106,10 +106,7 @@ uiomove(void *buf, size_t n, struct uio *uio) 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;