Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/dm readd assertions noew with the correct struct



details:   https://anonhg.NetBSD.org/src/rev/6c64db537dc0
branches:  trunk
changeset: 768859:6c64db537dc0
user:      ahoka <ahoka%NetBSD.org@localhost>
date:      Sun Aug 28 07:22:48 2011 +0000

description:
readd assertions noew with the correct struct
im wondering why the module cflags didnt warn about this obvious typo

diffstat:

 sys/dev/dm/dm_target.c |  12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diffs (26 lines):

diff -r 8c30c7d6aba1 -r 6c64db537dc0 sys/dev/dm/dm_target.c
--- a/sys/dev/dm/dm_target.c    Sun Aug 28 06:08:15 2011 +0000
+++ b/sys/dev/dm/dm_target.c    Sun Aug 28 07:22:48 2011 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_target.c,v 1.17 2011/08/27 23:31:12 joerg Exp $      */
+/*        $NetBSD: dm_target.c,v 1.18 2011/08/28 07:22:48 ahoka Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -150,6 +150,16 @@
 {
        dm_target_t *dmt;
 
+       /* Sanity check for any missing function */
+       KASSERT(dm_target->init != NULL);
+       KASSERT(dm_target->status != NULL);
+       KASSERT(dm_target->strategy != NULL);
+       KASSERT(dm_target->deps != NULL);
+       KASSERT(dm_target->destroy != NULL);
+       KASSERT(dm_target->upcall != NULL);
+       KASSERT(dm_target->sync != NULL);
+       KASSERT(dm_target->secsize != NULL);
+
        mutex_enter(&dm_target_mutex);
 
        dmt = dm_target_lookup_name(dm_target->name);



Home | Main Index | Thread Index | Old Index