Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Don't display step-by-step detailed error messages u...



details:   https://anonhg.NetBSD.org/src/rev/640dc6b589ab
branches:  trunk
changeset: 352309:640dc6b589ab
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sat Mar 25 07:00:33 2017 +0000

description:
Don't display step-by-step detailed error messages unless DIAGNOSTIC.

Among other things, this avoids expected "error messages" when the
module is being auto-unloaded while one or more units are still in
use.

diffstat:

 sys/dev/vnd.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (63 lines):

diff -r bc346ef72e1d -r 640dc6b589ab sys/dev/vnd.c
--- a/sys/dev/vnd.c     Sat Mar 25 05:58:50 2017 +0000
+++ b/sys/dev/vnd.c     Sat Mar 25 07:00:33 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vnd.c,v 1.258 2016/08/05 08:21:24 pgoyette Exp $       */
+/*     $NetBSD: vnd.c,v 1.259 2017/03/25 07:00:33 pgoyette Exp $       */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.258 2016/08/05 08:21:24 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.259 2017/03/25 07:00:33 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -2071,8 +2071,10 @@
                error = config_cfattach_attach(vnd_cd.cd_name, &vnd_ca);
                if (error) {
                        config_cfdriver_detach(&vnd_cd);
+#ifdef DIAGNOSTIC
                        aprint_error("%s: unable to register cfattach for \n"
                            "%s, error %d", __func__, vnd_cd.cd_name, error);
+#endif
                        break;
                }
 
@@ -2087,8 +2089,10 @@
                if (error) {
                        config_cfattach_detach(vnd_cd.cd_name, &vnd_ca);
                        config_cfdriver_detach(&vnd_cd);
+#ifdef DIAGNOSTIC
                         aprint_error("%s: unable to attach %s devsw, "
                             "error %d", __func__, vnd_cd.cd_name, error);
+#endif
                        break;
                }
 #endif
@@ -2108,8 +2112,10 @@
                 if (error) { 
                         (void)devsw_attach("vnd", &vnd_bdevsw, &vnd_bmajor,
                             &vnd_cdevsw, &vnd_cmajor);
+#ifdef DIAGNOSTIC
                         aprint_error("%s: failed to detach %s cfattach, "
                             "error %d\n", __func__, vnd_cd.cd_name, error);
+#endif
                         break;
                 }
                 error = config_cfdriver_detach(&vnd_cd);
@@ -2117,9 +2123,11 @@
                         (void)config_cfattach_attach(vnd_cd.cd_name, &vnd_ca); 
                         (void)devsw_attach("vnd", &vnd_bdevsw, &vnd_bmajor,
                             &vnd_cdevsw, &vnd_cmajor);
+#ifdef DIAGNOSTIC
                         aprint_error("%s: failed to detach %s cfdriver, "
                             "error %d\n", __func__, vnd_cd.cd_name, error);
                         break;
+#endif
                 }
 #endif
                break;



Home | Main Index | Thread Index | Old Index