Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Update the devlist2h.awk script to track the maximum...



details:   https://anonhg.NetBSD.org/src/rev/668fad3475e4
branches:  trunk
changeset: 348553:668fad3475e4
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Wed Oct 26 01:03:23 2016 +0000

description:
Update the devlist2h.awk script to track the maximum lengths of vendor
and product strings, and report the max values at end of the run.

Update the Makefiles.{pci,usb,hdaudio}devs to point users at the places
which might need to be updated if the maximum lengths get larger.

Since this commit makes no changes to the generated files, we don't
need to regenerate them now.

diffstat:

 sys/dev/devlist2h.awk                |  19 +++++++++++++++++--
 sys/dev/hdaudio/Makefile.hdaudiodevs |   9 +++++++--
 sys/dev/pci/Makefile.pcidevs         |  10 ++++++++--
 sys/dev/usb/Makefile.usbdevs         |  11 +++++++++--
 4 files changed, 41 insertions(+), 8 deletions(-)

diffs (138 lines):

diff -r 0bf48a9e6e3e -r 668fad3475e4 sys/dev/devlist2h.awk
--- a/sys/dev/devlist2h.awk     Tue Oct 25 21:50:15 2016 +0000
+++ b/sys/dev/devlist2h.awk     Wed Oct 26 01:03:23 2016 +0000
@@ -1,5 +1,5 @@
 #! /usr/bin/awk -f
-#      $NetBSD: devlist2h.awk,v 1.1 2014/09/21 14:30:22 christos Exp $
+#      $NetBSD: devlist2h.awk,v 1.2 2016/10/26 01:03:23 pgoyette Exp $
 #
 # Copyright (c) 1995, 1996 Christopher G. Demetriou
 # All rights reserved.
@@ -31,6 +31,7 @@
 #
 NR == 1 {
        nproducts = nvendors = blanklines = 0
+       vendormaxlen = productmaxlen = 0
        nchars = 1
        dfile= FILENAME "_data.h"
        hfile= FILENAME ".h"
@@ -117,6 +118,10 @@
                printf(" */") > hfile
        printf("\n") > hfile
 
+       if (length($2) > vendormaxlen) {
+               vendormaxlen = length($2)
+       }
+
        next
 }
 NF > 0 && $1 == "product" {
@@ -131,7 +136,7 @@
        i=4; f = 5;
 
        # comments
-       ocomment = oparen = 0
+       productlen = ocomment = oparen = 0
        if (f <= NF) {
                printf("\t\t/* ") > hfile
                ocomment = 1;
@@ -161,6 +166,7 @@
                        wordlist[nwords, 3] = nchars;
                        nchars = nchars + l + 1;
                }
+               productlen += words[$f, 2] + 1;
                wordlist[words[$f, 1], 2]++;
                products[nproducts, i] = words[$f, 1];
                printf("%s", $f) > hfile
@@ -174,6 +180,10 @@
                printf(" */") > hfile
        printf("\n") > hfile
 
+       if (productlen > productmaxlen) {
+               productmaxlen = productlen;
+       }
+
        next
 }
 {
@@ -240,6 +250,11 @@
 
        printf("\n") > dfile
 
+       printf("Maximum vendor string length:  %d\n", vendormaxlen + 1)
+       printf("Maximum product string length: %d\n", productmaxlen + 1)
+       printf("\nEnsure that device-specific values are sufficiently large");
+       printf("\ncheck Makefile.%s for details).\n", FILENAME);
+
        close(dfile)
        close(hfile)
 }
diff -r 0bf48a9e6e3e -r 668fad3475e4 sys/dev/hdaudio/Makefile.hdaudiodevs
--- a/sys/dev/hdaudio/Makefile.hdaudiodevs      Tue Oct 25 21:50:15 2016 +0000
+++ b/sys/dev/hdaudio/Makefile.hdaudiodevs      Wed Oct 26 01:03:23 2016 +0000
@@ -1,11 +1,16 @@
-#      $NetBSD: Makefile.hdaudiodevs,v 1.2 2015/05/30 14:10:01 jmcneill Exp $
+#      $NetBSD: Makefile.hdaudiodevs,v 1.3 2016/10/26 01:03:23 pgoyette Exp $
 #
 # As per tron%NetBSD.org@localhost, the proper procedure is
 #
 # 1.) Change "src/sys/dev/hdaudio/hdaudiodevs".
 # 2.) Commit "src/sys/dev/hdaudio/hdaudiodevs".
 # 3.) Execute "make -f Makefile.hdaudiodevs" in "src/sys/dev/hdaudio".
-# 4.) Commit "src/sys/dev/hdaudio/hdaudiodevs.h" and "src/sys/dev/hdaudio/hdaudiodevs_data.h".
+# 4.) Ensure that the value of MAX_AUDIO_DEV_LEN is at least as large as
+#     the values reported.  If necessary, update "src/sys/sys/audioio.h"
+#     and bump the kernel version in "src/sys/sys/param/h".
+# 5.) Commit "src/sys/dev/hdaudio/hdaudiodevs.h" and
+#     "src/sys/dev/hdaudio/hdaudiodevs_data.h"; if you changed them, also
+#     commit "src/sys/sys/audioio.h" and "src/sys/sys/param/h".
 
 .include <bsd.own.mk>
 
diff -r 0bf48a9e6e3e -r 668fad3475e4 sys/dev/pci/Makefile.pcidevs
--- a/sys/dev/pci/Makefile.pcidevs      Tue Oct 25 21:50:15 2016 +0000
+++ b/sys/dev/pci/Makefile.pcidevs      Wed Oct 26 01:03:23 2016 +0000
@@ -1,11 +1,17 @@
-#      $NetBSD: Makefile.pcidevs,v 1.6 2014/09/21 14:30:22 christos Exp $
+#      $NetBSD: Makefile.pcidevs,v 1.7 2016/10/26 01:03:23 pgoyette Exp $
 #
 # As per tron%NetBSD.org@localhost, the proper procedure is
 #
 # 1.) Change "src/sys/dev/pci/pcidevs".
 # 2.) Commit "src/sys/dev/pci/pcidevs".
 # 3.) Execute "make -f Makefile.pcidevs" in "src/sys/dev/pci".
-# 4.) Commit "src/sys/dev/pci/pcidevs.h" and "src/sys/dev/pci/pcidevs_data.h".
+# 4.) Ensure that the values of PCI_VENDORSTR_LEN and PCI_PRODUCTSTR_LEN
+#     are at least as large as the values reported.  If necessary, update
+#     the values in "src/sys/dev/pci/pci_verbose.h" and bump the kernel
+#     version in "src/sys/sys/param/h".
+# 5.) Commit "src/sys/dev/pci/pcidevs.h" and "src/sys/dev/pci/pcidevs_data.h";
+#     if you changed them, also commit "src/sys/dev/pci/pci_verbose.h" and
+#     "src/sys/sys/param/h".
 
 .include <bsd.own.mk>
 
diff -r 0bf48a9e6e3e -r 668fad3475e4 sys/dev/usb/Makefile.usbdevs
--- a/sys/dev/usb/Makefile.usbdevs      Tue Oct 25 21:50:15 2016 +0000
+++ b/sys/dev/usb/Makefile.usbdevs      Wed Oct 26 01:03:23 2016 +0000
@@ -1,11 +1,18 @@
-#      $NetBSD: Makefile.usbdevs,v 1.7 2014/09/21 14:30:22 christos Exp $
+#      $NetBSD: Makefile.usbdevs,v 1.8 2016/10/26 01:03:23 pgoyette Exp $
 #
 # As per tron%NetBSD.org@localhost, the proper procedure is
 #
 # 1.) Change "src/sys/dev/usb/usbdevs".
 # 2.) Commit "src/sys/dev/usb/usbdevs".
 # 3.) Execute "make -f Makefile.usbdevs" in "src/sys/dev/usb".
-# 4.) Commit "src/sys/dev/usb/usbdevs.h" and "src/sys/dev/usb/usbdevs_data.h".
+
+# 4.) Ensure that the value of USB_MAX_STRING_LEN is at least as large as
+#     the values reported.  If necessary, update "src/sys/dev/usb/usb.h"
+#     and bump the kernel version in "src/sys/sys/param/h".
+# 5.) Commit "src/sys/dev/usb/usbdevs.h" and "src/sys/dev/usb/usbdevs_data.h";
+#     if you changed them, also commit "src/sys/dev/usb/usb.h" and
+#     "src/sys/sys/param/h".
+
 
 .include <bsd.own.mk>
 



Home | Main Index | Thread Index | Old Index