Sat Aug 27 23:31:12 2011 UTC ()
Revert last, assertions on undefined variables don't make sense.


(joerg)
diff -r1.16 -r1.17 src/sys/dev/dm/dm_target.c

cvs diff -r1.16 -r1.17 src/sys/dev/dm/dm_target.c (expand / switch to unified diff)

--- src/sys/dev/dm/dm_target.c 2011/08/27 17:06:08 1.16
+++ src/sys/dev/dm/dm_target.c 2011/08/27 23:31:12 1.17
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: dm_target.c,v 1.16 2011/08/27 17:06:08 ahoka Exp $ */ 1/* $NetBSD: dm_target.c,v 1.17 2011/08/27 23:31:12 joerg Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Adam Hamsik. 8 * by Adam Hamsik.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code Must retain the above copyright 13 * 1. Redistributions of source code Must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -140,36 +140,26 @@ dm_target_lookup_name(const char *dm_tar @@ -140,36 +140,26 @@ dm_target_lookup_name(const char *dm_tar
140 140
141 return NULL; 141 return NULL;
142} 142}
143/* 143/*
144 * Insert new target struct into the TAIL. 144 * Insert new target struct into the TAIL.
145 * dm_target 145 * dm_target
146 * contains name, version, function pointer to specifif target functions. 146 * contains name, version, function pointer to specifif target functions.
147 */ 147 */
148int 148int
149dm_target_insert(dm_target_t * dm_target) 149dm_target_insert(dm_target_t * dm_target)
150{ 150{
151 dm_target_t *dmt; 151 dm_target_t *dmt;
152 152
153 /* Sanity check for any missing function */ 
154 KASSERT(dmt->init != NULL); 
155 KASSERT(dmt->status != NULL); 
156 KASSERT(dmt->strategy != NULL); 
157 KASSERT(dmt->deps != NULL); 
158 KASSERT(dmt->destroy != NULL); 
159 KASSERT(dmt->upcall != NULL); 
160 KASSERT(dmt->sync != NULL); 
161 KASSERT(dmt->secsize != NULL); 
162 
163 mutex_enter(&dm_target_mutex); 153 mutex_enter(&dm_target_mutex);
164 154
165 dmt = dm_target_lookup_name(dm_target->name); 155 dmt = dm_target_lookup_name(dm_target->name);
166 if (dmt != NULL) { 156 if (dmt != NULL) {
167 mutex_exit(&dm_target_mutex); 157 mutex_exit(&dm_target_mutex);
168 return EEXIST; 158 return EEXIST;
169 } 159 }
170 TAILQ_INSERT_TAIL(&dm_target_list, dm_target, dm_target_next); 160 TAILQ_INSERT_TAIL(&dm_target_list, dm_target, dm_target_next);
171 161
172 mutex_exit(&dm_target_mutex); 162 mutex_exit(&dm_target_mutex);
173 163
174 return 0; 164 return 0;
175} 165}