Module Name: src Committed By: maxv Date: Sun Jun 3 10:24:25 UTC 2018
Modified Files: src/sys/dev/pci/ixgbe: ixgbe.c ixv.c Log Message: Constify several variables in ixgbe/ so that they land in .rodata (1038 bytes). To generate a diff of this commit: cvs rdiff -u -r1.158 -r1.159 src/sys/dev/pci/ixgbe/ixgbe.c cvs rdiff -u -r1.102 -r1.103 src/sys/dev/pci/ixgbe/ixv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ixgbe/ixgbe.c diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.158 src/sys/dev/pci/ixgbe/ixgbe.c:1.159 --- src/sys/dev/pci/ixgbe/ixgbe.c:1.158 Wed May 30 09:17:17 2018 +++ src/sys/dev/pci/ixgbe/ixgbe.c Sun Jun 3 10:24:24 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe.c,v 1.158 2018/05/30 09:17:17 msaitoh Exp $ */ +/* $NetBSD: ixgbe.c,v 1.159 2018/06/03 10:24:24 maxv Exp $ */ /****************************************************************************** @@ -80,7 +80,7 @@ /************************************************************************ * Driver version ************************************************************************/ -char ixgbe_driver_version[] = "4.0.1-k"; +static const char ixgbe_driver_version[] = "4.0.1-k"; /************************************************************************ @@ -92,7 +92,7 @@ char ixgbe_driver_version[] = "4.0.1-k"; * * { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index } ************************************************************************/ -static ixgbe_vendor_info_t ixgbe_vendor_info_array[] = +static const ixgbe_vendor_info_t ixgbe_vendor_info_array[] = { {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_DUAL_PORT, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_SINGLE_PORT, 0, 0, 0}, @@ -266,7 +266,7 @@ static void ixgbe_handle_phy(void *); /* Workqueue handler for deferred work */ static void ixgbe_handle_que_work(struct work *, void *); -static ixgbe_vendor_info_t *ixgbe_lookup(const struct pci_attach_args *); +static const ixgbe_vendor_info_t *ixgbe_lookup(const struct pci_attach_args *); /************************************************************************ * NetBSD Device Interface Entry Points @@ -769,7 +769,7 @@ ixgbe_attach(device_t parent, device_t d u32 ctrl_ext; u16 high, low, nvmreg; pcireg_t id, subid; - ixgbe_vendor_info_t *ent; + const ixgbe_vendor_info_t *ent; struct pci_attach_args *pa = aux; const char *str; char buf[256]; @@ -5934,10 +5934,10 @@ ixgbe_probe(device_t dev, cfdata_t cf, v return (ixgbe_lookup(pa) != NULL) ? 1 : 0; } -static ixgbe_vendor_info_t * +static const ixgbe_vendor_info_t * ixgbe_lookup(const struct pci_attach_args *pa) { - ixgbe_vendor_info_t *ent; + const ixgbe_vendor_info_t *ent; pcireg_t subid; INIT_DEBUGOUT("ixgbe_lookup: begin"); Index: src/sys/dev/pci/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.102 src/sys/dev/pci/ixgbe/ixv.c:1.103 --- src/sys/dev/pci/ixgbe/ixv.c:1.102 Wed May 30 08:35:26 2018 +++ src/sys/dev/pci/ixgbe/ixv.c Sun Jun 3 10:24:24 2018 @@ -1,4 +1,4 @@ -/*$NetBSD: ixv.c,v 1.102 2018/05/30 08:35:26 msaitoh Exp $*/ +/*$NetBSD: ixv.c,v 1.103 2018/06/03 10:24:24 maxv Exp $*/ /****************************************************************************** @@ -46,7 +46,7 @@ /************************************************************************ * Driver version ************************************************************************/ -char ixv_driver_version[] = "2.0.1-k"; +static const char ixv_driver_version[] = "2.0.1-k"; /************************************************************************ * PCI Device ID Table @@ -57,7 +57,7 @@ char ixv_driver_version[] = "2.0.1-k"; * * { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index } ************************************************************************/ -static ixgbe_vendor_info_t ixv_vendor_info_array[] = +static const ixgbe_vendor_info_t ixv_vendor_info_array[] = { {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_VF, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540_VF, 0, 0, 0}, @@ -154,7 +154,7 @@ static void ixv_handle_link(void *); static void ixv_handle_que_work(struct work *, void *); const struct sysctlnode *ixv_sysctl_instance(struct adapter *); -static ixgbe_vendor_info_t *ixv_lookup(const struct pci_attach_args *); +static const ixgbe_vendor_info_t *ixv_lookup(const struct pci_attach_args *); /************************************************************************ * FreeBSD Device Interface Entry Points @@ -259,10 +259,10 @@ ixv_probe(device_t dev, cfdata_t cf, voi #endif } /* ixv_probe */ -static ixgbe_vendor_info_t * +static const ixgbe_vendor_info_t * ixv_lookup(const struct pci_attach_args *pa) { - ixgbe_vendor_info_t *ent; + const ixgbe_vendor_info_t *ent; pcireg_t subid; INIT_DEBUGOUT("ixv_lookup: begin"); @@ -302,7 +302,7 @@ ixv_attach(device_t parent, device_t dev struct ixgbe_hw *hw; int error = 0; pcireg_t id, subid; - ixgbe_vendor_info_t *ent; + const ixgbe_vendor_info_t *ent; const struct pci_attach_args *pa = aux; const char *apivstr; const char *str;