Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86/x86 centralize the double match warning.
details: https://anonhg.NetBSD.org/src/rev/0c335999ca92
branches: trunk
changeset: 329820:0c335999ca92
user: christos <christos%NetBSD.org@localhost>
date: Tue Jun 10 22:01:40 2014 +0000
description:
centralize the double match warning.
diffstat:
sys/arch/x86/x86/x86_autoconf.c | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diffs (67 lines):
diff -r cefa14f2b4e8 -r 0c335999ca92 sys/arch/x86/x86/x86_autoconf.c
--- a/sys/arch/x86/x86/x86_autoconf.c Tue Jun 10 20:23:21 2014 +0000
+++ b/sys/arch/x86/x86/x86_autoconf.c Tue Jun 10 22:01:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: x86_autoconf.c,v 1.70 2014/04/03 15:21:52 christos Exp $ */
+/* $NetBSD: x86_autoconf.c,v 1.71 2014/06/10 22:01:40 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.70 2014/04/03 15:21:52 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.71 2014/06/10 22:01:40 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -70,6 +70,14 @@
#define DPRINTF(a)
#endif
+static void
+dmatch(const char *func, device_t dv)
+{
+
+ printf("WARNING: %s: double match for boot device (%s, %s)\n",
+ func, device_xname(booted_device), device_xname(dv));
+}
+
static int
is_valid_disk(device_t dv)
{
@@ -388,10 +396,7 @@
continue;
bootwedge_found:
if (booted_device) {
- printf("WARNING: double match for boot "
- "device (%s, %s)\n",
- device_xname(booted_device),
- device_xname(dv));
+ dmatch(__func__, dv);
continue;
}
booted_device = dv;
@@ -450,10 +455,7 @@
continue;
bootdisk_found:
if (booted_device) {
- printf("WARNING: double match for boot "
- "device (%s, %s)\n",
- device_xname(booted_device),
- device_xname(dv));
+ dmatch(__func__, dv);
continue;
}
booted_device = dv;
@@ -540,8 +542,7 @@
if (booted_device != NULL) {
/* XXX should be a panic() */
- printf("WARNING: double match for boot device (%s, %s)\n",
- device_xname(booted_device), device_xname(dev));
+ dmatch(__func__, dev);
} else
booted_device = (isaboot != NULL) ? isaboot : pciboot;
}
Home |
Main Index |
Thread Index |
Old Index