summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1998-07-21 20:35:19 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1998-07-21 20:35:19 +0000
commit466a5fc18c4337403b975a90c5f7ac1830ade216 (patch)
treef76958dde2d0d9181fe56963c07d706f210a9a05
parent55f6d1f57b46714c563a933844a6f7c8e71c293c (diff)
check for vendor name dups
-rw-r--r--sys/dev/pci/devlist2h.awk12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/pci/devlist2h.awk b/sys/dev/pci/devlist2h.awk
index 2afb16afbe3..d4f4748f955 100644
--- a/sys/dev/pci/devlist2h.awk
+++ b/sys/dev/pci/devlist2h.awk
@@ -1,5 +1,5 @@
#! /usr/bin/awk -f
-# $OpenBSD: devlist2h.awk,v 1.3 1997/11/07 08:07:26 niklas Exp $
+# $OpenBSD: devlist2h.awk,v 1.4 1998/07/21 20:35:18 mickey Exp $
# $NetBSD: devlist2h.awk,v 1.2 1996/01/22 21:08:09 cgd Exp $
#
# Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -31,7 +31,7 @@
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
BEGIN {
- nproducts = nvendors = 0
+ nproducts = nvendor_dup = nvendors = 0
dfile="pcidevs_data.h"
hfile="pcidevs.h"
}
@@ -60,6 +60,11 @@ NR == 1 {
$1 == "vendor" {
nvendors++
+ if ($2 in vendorindex) {
+ printf("duplicate vendor name %s\n", $2);
+ nvendor_dup++;
+ }
+
vendorindex[$2] = nvendors; # record index for this name, for later.
vendors[nvendors, 1] = $2; # name
vendors[nvendors, 2] = $3; # id
@@ -159,6 +164,9 @@ END {
printf("\n") > dfile
+ if (nvendor_dup > 0)
+ exit(1);
+
printf("struct pci_knowndev pci_knowndevs[] = {\n") > dfile
for (i = 1; i <= nproducts; i++) {
printf("\t{\n") > dfile