diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-01-26 22:27:38 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-01-26 22:27:38 +0000 |
commit | 5ef821b83cdecff7ecb24300de3696f23f19a858 (patch) | |
tree | c808802018e5977132d33142ab6a308e62f279d2 /sys | |
parent | c89c0eb08e0327923fced47fa39211c1fb2480d1 (diff) |
constify pci_knowndevs
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/devlist2h.awk | 4 | ||||
-rw-r--r-- | sys/dev/pci/pci_subr.c | 42 |
2 files changed, 23 insertions, 23 deletions
diff --git a/sys/dev/pci/devlist2h.awk b/sys/dev/pci/devlist2h.awk index d4f4748f955..84693e98be1 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.4 1998/07/21 20:35:18 mickey Exp $ +# $OpenBSD: devlist2h.awk,v 1.5 2001/01/26 22:27:37 mickey Exp $ # $NetBSD: devlist2h.awk,v 1.2 1996/01/22 21:08:09 cgd Exp $ # # Copyright (c) 1995, 1996 Christopher G. Demetriou @@ -167,7 +167,7 @@ END { if (nvendor_dup > 0) exit(1); - printf("struct pci_knowndev pci_knowndevs[] = {\n") > dfile + printf("static const struct pci_knowndev pci_knowndevs[] = {\n") > dfile for (i = 1; i <= nproducts; i++) { printf("\t{\n") > dfile printf("\t PCI_VENDOR_%s, PCI_PRODUCT_%s_%s,\n", diff --git a/sys/dev/pci/pci_subr.c b/sys/dev/pci/pci_subr.c index 3ae068289a5..96fa2babaef 100644 --- a/sys/dev/pci/pci_subr.c +++ b/sys/dev/pci/pci_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_subr.c,v 1.9 2001/01/16 23:35:31 d Exp $ */ +/* $OpenBSD: pci_subr.c,v 1.10 2001/01/26 22:27:36 mickey Exp $ */ /* $NetBSD: pci_subr.c,v 1.19 1996/10/13 01:38:29 christos Exp $ */ /* @@ -52,18 +52,18 @@ * NULL subclass pointer. */ struct pci_class { - char *name; + const char *name; int val; /* as wide as pci_{,sub}class_t */ - struct pci_class *subclasses; + const struct pci_class *subclasses; }; -struct pci_class pci_subclass_prehistoric[] = { +const struct pci_class pci_subclass_prehistoric[] = { { "miscellaneous", PCI_SUBCLASS_PREHISTORIC_MISC, }, { "VGA", PCI_SUBCLASS_PREHISTORIC_VGA, }, { 0 } }; -struct pci_class pci_subclass_mass_storage[] = { +const struct pci_class pci_subclass_mass_storage[] = { { "SCSI", PCI_SUBCLASS_MASS_STORAGE_SCSI, }, { "IDE", PCI_SUBCLASS_MASS_STORAGE_IDE, }, { "floppy", PCI_SUBCLASS_MASS_STORAGE_FLOPPY, }, @@ -73,7 +73,7 @@ struct pci_class pci_subclass_mass_storage[] = { { 0 }, }; -struct pci_class pci_subclass_network[] = { +const struct pci_class pci_subclass_network[] = { { "ethernet", PCI_SUBCLASS_NETWORK_ETHERNET, }, { "token ring", PCI_SUBCLASS_NETWORK_TOKENRING, }, { "FDDI", PCI_SUBCLASS_NETWORK_FDDI, }, @@ -82,28 +82,28 @@ struct pci_class pci_subclass_network[] = { { 0 }, }; -struct pci_class pci_subclass_display[] = { +const struct pci_class pci_subclass_display[] = { { "VGA", PCI_SUBCLASS_DISPLAY_VGA, }, { "XGA", PCI_SUBCLASS_DISPLAY_XGA, }, { "miscellaneous", PCI_SUBCLASS_DISPLAY_MISC, }, { 0 }, }; -struct pci_class pci_subclass_multimedia[] = { +const struct pci_class pci_subclass_multimedia[] = { { "video", PCI_SUBCLASS_MULTIMEDIA_VIDEO, }, { "audio", PCI_SUBCLASS_MULTIMEDIA_AUDIO, }, { "miscellaneous", PCI_SUBCLASS_MULTIMEDIA_MISC, }, { 0 }, }; -struct pci_class pci_subclass_memory[] = { +const struct pci_class pci_subclass_memory[] = { { "RAM", PCI_SUBCLASS_MEMORY_RAM, }, { "flash", PCI_SUBCLASS_MEMORY_FLASH, }, { "miscellaneous", PCI_SUBCLASS_MEMORY_MISC, }, { 0 }, }; -struct pci_class pci_subclass_bridge[] = { +const struct pci_class pci_subclass_bridge[] = { { "host", PCI_SUBCLASS_BRIDGE_HOST, }, { "ISA", PCI_SUBCLASS_BRIDGE_ISA, }, { "EISA", PCI_SUBCLASS_BRIDGE_EISA, }, @@ -116,14 +116,14 @@ struct pci_class pci_subclass_bridge[] = { { 0 }, }; -struct pci_class pci_subclass_communications[] = { +const struct pci_class pci_subclass_communications[] = { { "serial", PCI_SUBCLASS_COMMUNICATIONS_SERIAL, }, { "parallel", PCI_SUBCLASS_COMMUNICATIONS_PARALLEL, }, { "miscellaneous", PCI_SUBCLASS_COMMUNICATIONS_MISC, }, { 0 }, }; -struct pci_class pci_subclass_system[] = { +const struct pci_class pci_subclass_system[] = { { "8259 PIC", PCI_SUBCLASS_SYSTEM_PIC, }, { "8237 DMA", PCI_SUBCLASS_SYSTEM_DMA, }, { "8254 timer", PCI_SUBCLASS_SYSTEM_TIMER, }, @@ -132,7 +132,7 @@ struct pci_class pci_subclass_system[] = { { 0 }, }; -struct pci_class pci_subclass_input[] = { +const struct pci_class pci_subclass_input[] = { { "keyboard", PCI_SUBCLASS_INPUT_KEYBOARD, }, { "digitizer", PCI_SUBCLASS_INPUT_DIGITIZER, }, { "mouse", PCI_SUBCLASS_INPUT_MOUSE, }, @@ -140,13 +140,13 @@ struct pci_class pci_subclass_input[] = { { 0 }, }; -struct pci_class pci_subclass_dock[] = { +const struct pci_class pci_subclass_dock[] = { { "generic", PCI_SUBCLASS_DOCK_GENERIC, }, { "miscellaneous", PCI_SUBCLASS_DOCK_MISC, }, { 0 }, }; -struct pci_class pci_subclass_processor[] = { +const struct pci_class pci_subclass_processor[] = { { "386", PCI_SUBCLASS_PROCESSOR_386, }, { "486", PCI_SUBCLASS_PROCESSOR_486, }, { "Pentium", PCI_SUBCLASS_PROCESSOR_PENTIUM, }, @@ -156,7 +156,7 @@ struct pci_class pci_subclass_processor[] = { { 0 }, }; -struct pci_class pci_subclass_serialbus[] = { +const struct pci_class pci_subclass_serialbus[] = { { "Firewire", PCI_SUBCLASS_SERIALBUS_FIREWIRE, }, { "ACCESS.bus", PCI_SUBCLASS_SERIALBUS_ACCESS, }, { "SSA", PCI_SUBCLASS_SERIALBUS_SSA, }, @@ -165,7 +165,7 @@ struct pci_class pci_subclass_serialbus[] = { { 0 }, }; -struct pci_class pci_class[] = { +const struct pci_class pci_class[] = { { "prehistoric", PCI_CLASS_PREHISTORIC, pci_subclass_prehistoric, }, { "mass storage", PCI_CLASS_MASS_STORAGE, @@ -205,7 +205,7 @@ struct pci_knowndev { pci_vendor_id_t vendor; pci_product_id_t product; int flags; - char *vendorname, *productname; + const char *vendorname, *productname; }; #define PCI_KNOWNDEV_NOPROD 0x01 /* match on vendor only */ @@ -224,10 +224,10 @@ pci_devinfo(id_reg, class_reg, showclass, cp) pci_subclass_t subclass; pci_interface_t interface; pci_revision_t revision; - char *vendor_namep, *product_namep; - struct pci_class *classp, *subclassp; + const char *vendor_namep, *product_namep; + const struct pci_class *classp, *subclassp; #ifdef PCIVERBOSE - struct pci_knowndev *kdp; + const struct pci_knowndev *kdp; const char *unmatched = "unknown "; #else const char *unmatched = ""; |