Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Fix KASSERTMSG() to be consistent with KASSERT() logic, ...
details: https://anonhg.NetBSD.org/src/rev/4b72b4f66b33
branches: trunk
changeset: 754268:4b72b4f66b33
user: rmind <rmind%NetBSD.org@localhost>
date: Sun Apr 25 15:39:41 2010 +0000
description:
Fix KASSERTMSG() to be consistent with KASSERT() logic, not inverted.
Hi matt@!
diffstat:
sys/arch/mips/mips/syscall.c | 8 +++++---
sys/dev/ic/siisata.c | 8 ++++----
sys/lib/libkern/libkern.h | 4 ++--
3 files changed, 11 insertions(+), 9 deletions(-)
diffs (83 lines):
diff -r 2971dde3bcc3 -r 4b72b4f66b33 sys/arch/mips/mips/syscall.c
--- a/sys/arch/mips/mips/syscall.c Sun Apr 25 12:26:07 2010 +0000
+++ b/sys/arch/mips/mips/syscall.c Sun Apr 25 15:39:41 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: syscall.c,v 1.40 2009/12/14 18:39:19 skrll Exp $ */
+/* $NetBSD: syscall.c,v 1.41 2010/04/25 15:39:41 rmind Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -107,7 +107,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.40 2009/12/14 18:39:19 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.41 2010/04/25 15:39:41 rmind Exp $");
#if defined(_KERNEL_OPT)
#include "opt_sa.h"
@@ -174,7 +174,9 @@
int code, error;
#if defined(__mips_o32)
const int abi = _MIPS_BSD_API_O32;
- KASSERTMSG(p->p_md.md_abi != abi, ("pid %d(%p): md_abi(%d) != abi(%d)", p->p_pid, p, p->p_md.md_abi, abi));
+ KASSERTMSG(p->p_md.md_abi == abi,
+ ("pid %d(%p): md_abi(%d) != abi(%d)",
+ p->p_pid, p, p->p_md.md_abi, abi));
size_t nregs = 4;
#else
const int abi = p->p_md.md_abi;
diff -r 2971dde3bcc3 -r 4b72b4f66b33 sys/dev/ic/siisata.c
--- a/sys/dev/ic/siisata.c Sun Apr 25 12:26:07 2010 +0000
+++ b/sys/dev/ic/siisata.c Sun Apr 25 15:39:41 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.10 2010/04/07 17:51:16 jakllsch Exp $ */
+/* $NetBSD: siisata.c,v 1.11 2010/04/25 15:39:41 rmind Exp $ */
/* from ahcisata_core.c */
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.10 2010/04/07 17:51:16 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.11 2010/04/25 15:39:41 rmind Exp $");
#include <sys/types.h>
#include <sys/malloc.h>
@@ -1183,7 +1183,7 @@
sc = (struct siisata_softc *)schp->ata_channel.ch_atac;
- KASSERTMSG(((schp->sch_active_slots & __BIT(slot)) == __BIT(slot)),
+ KASSERTMSG((schp->sch_active_slots & __BIT(slot)) != __BIT(slot),
("%s: trying to activate active slot %d", SIISATANAME(sc), slot));
SIISATA_PRB_SYNC(sc, schp, slot, BUS_DMASYNC_PREWRITE);
@@ -1205,7 +1205,7 @@
sc = (struct siisata_softc *)schp->ata_channel.ch_atac;
- KASSERTMSG(((schp->sch_active_slots & __BIT(slot)) == 0),
+ KASSERTMSG((schp->sch_active_slots & __BIT(slot)) != 0,
("%s: trying to deactivate inactive slot %d", SIISATANAME(sc),
slot));
diff -r 2971dde3bcc3 -r 4b72b4f66b33 sys/lib/libkern/libkern.h
--- a/sys/lib/libkern/libkern.h Sun Apr 25 12:26:07 2010 +0000
+++ b/sys/lib/libkern/libkern.h Sun Apr 25 15:39:41 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: libkern.h,v 1.93 2010/01/19 22:28:30 pooka Exp $ */
+/* $NetBSD: libkern.h,v 1.94 2010/04/25 15:39:41 rmind Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -208,7 +208,7 @@
#else /* DIAGNOSTIC */
#define _DIAGASSERT(a) assert(a)
#define KASSERTMSG(e, msg) do { \
- if (__predict_false((e))) \
+ if (__predict_false(!(e))) \
panic msg; \
} while (/*CONSTCOND*/ 0)
#ifdef __STDC__
Home |
Main Index |
Thread Index |
Old Index