diff options
| author | maya <maya@NetBSD.org> | 2016-12-10 23:03:27 +0000 |
|---|---|---|
| committer | maya <maya@NetBSD.org> | 2016-12-10 23:03:27 +0000 |
| commit | b7a93be7b7e5ff830b7cc47099b423dc583797c2 (patch) | |
| tree | 7c05f6a7cf1fbb3c3973bb32157d4e2ec109c508 /sys/dev/raidframe | |
| parent | 5781081aed965835025f0778292b8a0d52de8ec3 (diff) | |
raidframe: use existing routines to print an error and panic.
fixes the i386 ALL build with clang which complained about the
format string not being a string literal, and lets us get rid of
rf_panicbuf.
note: kern_assert is not KASSERT. it should panic as long as the
string is not NULL.
No functional change intended.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_driver.c | 15 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_general.h | 6 |
2 files changed, 7 insertions, 14 deletions
diff --git a/sys/dev/raidframe/rf_driver.c b/sys/dev/raidframe/rf_driver.c index 5f795cb8947..77bdec0c566 100644 --- a/sys/dev/raidframe/rf_driver.c +++ b/sys/dev/raidframe/rf_driver.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_driver.c,v 1.132 2015/12/26 00:58:45 pgoyette Exp $ */ +/* $NetBSD: rf_driver.c,v 1.133 2016/12/10 23:03:27 maya Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. * All rights reserved. @@ -66,7 +66,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.132 2015/12/26 00:58:45 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.133 2016/12/10 23:03:27 maya Exp $"); #ifdef _KERNEL_OPT #include "opt_raid_diagnostic.h" @@ -121,9 +121,6 @@ __KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.132 2015/12/26 00:58:45 pgoyette Exp #define RF_MAX_FREE_RAD 128 #define RF_MIN_FREE_RAD 32 -/* debug variables */ -char rf_panicbuf[2048]; /* a buffer to hold an error msg when we panic */ - /* main configuration routines */ static int raidframe_booted = 0; @@ -888,17 +885,15 @@ rf_ConfigureDebug(RF_Config_t *cfgPtr) void rf_print_panic_message(int line, const char *file) { - snprintf(rf_panicbuf, sizeof(rf_panicbuf), - "raidframe error at line %d file %s", line, file); + kern_assert("raidframe error at line %d file %s", line, file); } #ifdef RAID_DIAGNOSTIC void rf_print_assert_panic_message(int line, const char *file, const char *condition) { - snprintf(rf_panicbuf, sizeof(rf_panicbuf), - "raidframe error at line %d file %s (failed asserting %s)\n", - line, file, condition); + kern_assert("raidframe error at line %d file %s (failed asserting %s)\n", + line, file, condition); } #endif diff --git a/sys/dev/raidframe/rf_general.h b/sys/dev/raidframe/rf_general.h index baf9437d06f..ca307cd61a1 100644 --- a/sys/dev/raidframe/rf_general.h +++ b/sys/dev/raidframe/rf_general.h @@ -1,4 +1,4 @@ -/* $NetBSD: rf_general.h,v 1.21 2014/03/25 16:19:14 christos Exp $ */ +/* $NetBSD: rf_general.h,v 1.22 2016/12/10 23:03:27 maya Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -54,14 +54,12 @@ void rf_print_unable_to_init_mutex(const char *, int, int); void rf_print_unable_to_add_shutdown(const char *, int, int); -extern char rf_panicbuf[]; -#define RF_PANIC() {rf_print_panic_message(__LINE__,__FILE__); panic("%s", rf_panicbuf);} +#define RF_PANIC() {rf_print_panic_message(__LINE__,__FILE__);} #if defined(RAID_DIAGNOSTIC) || defined(__COVERITY__) #define RF_ASSERT(_x_) { \ if (!(_x_)) { \ rf_print_assert_panic_message(__LINE__, __FILE__, #_x_); \ - panic(rf_panicbuf); \ } \ } #else /* RAID_DIAGNOSTIC */ |
