Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hp700/hp700 Change #ifdef DIAGNOSITC tests+panic to...
details: https://anonhg.NetBSD.org/src/rev/a5a28776f90e
branches: trunk
changeset: 753572:a5a28776f90e
user: skrll <skrll%NetBSD.org@localhost>
date: Fri Apr 02 15:24:18 2010 +0000
description:
Change #ifdef DIAGNOSITC tests+panic to KASSERTs.
diffstat:
sys/arch/hp700/hp700/mainbus.c | 22 +++++++---------------
1 files changed, 7 insertions(+), 15 deletions(-)
diffs (50 lines):
diff -r 5b265ec105cb -r a5a28776f90e sys/arch/hp700/hp700/mainbus.c
--- a/sys/arch/hp700/hp700/mainbus.c Fri Apr 02 15:23:17 2010 +0000
+++ b/sys/arch/hp700/hp700/mainbus.c Fri Apr 02 15:24:18 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mainbus.c,v 1.63 2010/04/01 12:21:41 skrll Exp $ */
+/* $NetBSD: mainbus.c,v 1.64 2010/04/02 15:24:18 skrll Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.63 2010/04/01 12:21:41 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.64 2010/04/02 15:24:18 skrll Exp $");
#include "locators.h"
#include "power.h"
@@ -954,10 +954,7 @@
map->dm_mapsize = 0;
map->dm_nsegs = 0;
-#ifdef DIAGNOSTIC
- if ((m0->m_flags & M_PKTHDR) == 0)
- panic("_bus_dmamap_load_mbuf: no packet header");
-#endif /* DIAGNOSTIC */
+ KASSERT(m0->m_flags & M_PKTHDR);
if (m0->m_pkthdr.len > map->_dm_size)
return (EINVAL);
@@ -1318,15 +1315,10 @@
int i;
for (i = 0; i < nsegs; i++) {
-#ifdef DIAGNOSTIC
- if (off & PGOFSET)
- panic("_bus_dmamem_mmap: offset unaligned");
- if (segs[i].ds_addr & PGOFSET)
- panic("_bus_dmamem_mmap: segment unaligned");
- if (segs[i].ds_len & PGOFSET)
- panic("_bus_dmamem_mmap: segment size not multiple"
- " of page size");
-#endif /* DIAGNOSTIC */
+ KASSERT((off & PGOFSET) == 0);
+ KASSERT((segs[i].ds_addr & PGOFSET) == 0);
+ KASSERT((segs[i].ds_len & PGOFSET) == 0);
+
if (off >= segs[i].ds_len) {
off -= segs[i].ds_len;
continue;
Home |
Main Index |
Thread Index |
Old Index