Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci/ixgbe Constify several variables in ixgbe/ so th...



details:   https://anonhg.NetBSD.org/src/rev/404a25c55784
branches:  trunk
changeset: 319568:404a25c55784
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sun Jun 03 10:24:24 2018 +0000

description:
Constify several variables in ixgbe/ so that they land in .rodata (1038
bytes).

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c |  14 +++++++-------
 sys/dev/pci/ixgbe/ixv.c   |  14 +++++++-------
 2 files changed, 14 insertions(+), 14 deletions(-)

diffs (116 lines):

diff -r 12a3e13bcc4e -r 404a25c55784 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Sun Jun 03 10:20:54 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Sun Jun 03 10:24:24 2018 +0000
@@ -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 @@
  *
  *   { 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 @@
 /* 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 @@
        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 @@
        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");
diff -r 12a3e13bcc4e -r 404a25c55784 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Sun Jun 03 10:20:54 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Sun Jun 03 10:24:24 2018 +0000
@@ -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 @@
  *
  *   { 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_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 @@
 #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 @@
        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;



Home | Main Index | Thread Index | Old Index