Module Name: src
Committed By: skrll
Date: Fri Apr 2 15:24:18 UTC 2010
Modified Files:
src/sys/arch/hp700/hp700: mainbus.c
Log Message:
Change #ifdef DIAGNOSITC tests+panic to KASSERTs.
To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/hp700/hp700/mainbus.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/hp700/hp700/mainbus.c
diff -u src/sys/arch/hp700/hp700/mainbus.c:1.63 src/sys/arch/hp700/hp700/mainbus.c:1.64
--- src/sys/arch/hp700/hp700/mainbus.c:1.63 Thu Apr 1 12:21:41 2010
+++ src/sys/arch/hp700/hp700/mainbus.c Fri Apr 2 15:24:18 2010
@@ -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;