From nobody Thu Aug 17 18:35:11 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RRYb33nhtz4mX2f; Thu, 17 Aug 2023 18:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RRYb33KGqz3TRT; Thu, 17 Aug 2023 18:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692297311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N0iQOQSOgwPF6JfJCLT16/LlMgqOmAvOd/78JilmtA8=; b=NhvIFJrtf+hk5ohPqk1iM5SoK8wFLHsDQMiK59+urnRJUi1hqfvkNeHVaR9xqrBZDd1w4K 3rZAsGuQkzwh7h8wWBYdjiMKmGLGVx6nYy5PqibHc6oY3zV9cPSPxhJWOglJ73R7GQX8wF 3LTLl8DF9mxrLRkKEcHhqDmrNTixwN6S/cWrWV6hQNu34QR7phRsrl8SMR7kiRqUjTWXVv bY2fbxjNVvRAPo4QCDSSzkSeEKVTvCBXBSNwx/WZBDqnawbbRjmns+gkGoxBc4uFJb8w+Z LS8Lr8Gsk39SV07wLjWGqi06gw+Vc+45RQZ2Wce5/05rjgSh7vJOeldvsY8k8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692297311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N0iQOQSOgwPF6JfJCLT16/LlMgqOmAvOd/78JilmtA8=; b=GxeVLfS3jdbde4VhDa7lFw9hjhDUAShj2/EVpZ5SI+qvD2T43d3/Z6Pb/WyBis9/mMu9Pp PiAGhWuqLTzCTv4HQ8wBg8o4Bqqk6eO+oWNXxxku47g2C19wnJIUyOFL/YHElBJRJ9GWxo riDbCPKvEsOe72t2xXVBkacPemk79IisOwtWmuhhFduyCptIS9C2YmZcF+91SO/JDLkS51 XsSsH7xVNaYWx9EKGXJrAFb7cXztqYHlQagUieLdSbBiXN8afC6VsJp33kJD8f59WMtYKY LO3e8xLIQDuf/p3MWuxTA6KHTtqnk3SyJOPVRqBhokjQCDQnBfLm/YcaeyTmRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692297311; a=rsa-sha256; cv=none; b=XUKeKD87Q7hX1bY9PruX8tfDjN745HEerxUtCR/moaaOr5hflC8gKN9sMK37MBC4XuQYhs +pi77qdhDS7HTVtlm3b9UMOAOFcnD7AW7o4+1OJpvJ+Fkj7jm9YI5K8j5u3w7w6JhlMFfq +8GfEWl22NA9CRn6+lWvCmEWg9f9TXrenUvphYd3gfdbRdKhnf3FxmdnUk/7UQoFrB5h1D oE11bgPWkfBPcNJj4MtB+bDM5a/5UOEr9KZik/V1Y4bINnRWxZ5o0q6Ui+zyPPPD/ldFjq tmy5n6Csn1ifD3ahM6jLTsVHBNaEn0U6nMKjel387EkuTjRS3z+P4Xyg+wir2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RRYb32MsVzlM7; Thu, 17 Aug 2023 18:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37HIZBPj047111; Thu, 17 Aug 2023 18:35:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37HIZBXD047108; Thu, 17 Aug 2023 18:35:11 GMT (envelope-from git) Date: Thu, 17 Aug 2023 18:35:11 GMT Message-Id: <202308171835.37HIZBXD047108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 51e235148a4b - main - iflib drivers: Constify PCI ID LUTs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 51e235148a4becba94e824a44bd69687644a7f56 Auto-Submitted: auto-generated The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=51e235148a4becba94e824a44bd69687644a7f56 commit 51e235148a4becba94e824a44bd69687644a7f56 Author: Marius Strobl AuthorDate: 2023-08-16 16:49:34 +0000 Commit: Marius Strobl CommitDate: 2023-08-17 18:34:23 +0000 iflib drivers: Constify PCI ID LUTs Since d49e83eac3baf16a22b1c5d42e8438b68b17e6f9, iflib(9) is ready for this change. While at it, make isc_driver_version strings (static) const where not apparently un-const on purpose, too. This reduces the size of the amd64 GENERIC by about 10 KiB. --- sys/dev/axgbe/if_axgbe_pci.c | 2 +- sys/dev/bnxt/bnxt.h | 2 +- sys/dev/bnxt/if_bnxt.c | 4 ++-- sys/dev/e1000/if_em.c | 8 ++++---- sys/dev/enetc/if_enetc.c | 2 +- sys/dev/enic/if_enic.c | 2 +- sys/dev/iavf/iavf_drv_info.h | 2 +- sys/dev/ice/ice_drv_info.h | 2 +- sys/dev/igc/if_igc.c | 2 +- sys/dev/ixgbe/if_ix.c | 4 ++-- sys/dev/ixgbe/if_ixv.c | 4 ++-- sys/dev/ixl/if_ixl.c | 2 +- sys/dev/mgb/if_mgb.c | 2 +- sys/dev/vmware/vmxnet3/if_vmx.c | 2 +- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sys/dev/axgbe/if_axgbe_pci.c b/sys/dev/axgbe/if_axgbe_pci.c index ac0bab896cb9..7f661e6d9c98 100644 --- a/sys/dev/axgbe/if_axgbe_pci.c +++ b/sys/dev/axgbe/if_axgbe_pci.c @@ -137,7 +137,7 @@ static struct resource_spec axgbe_pci_mac_spec[] = { { -1, 0 } }; -static pci_vendor_info_t axgbe_vendor_info_array[] = +static const pci_vendor_info_t axgbe_vendor_info_array[] = { PVID(0x1022, 0x1458, "AMD 10 Gigabit Ethernet Driver"), PVID(0x1022, 0x1459, "AMD 10 Gigabit Ethernet Driver"), diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 78b7e4ca6bf5..2b5c16e263d7 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -206,7 +206,7 @@ #define BNXT_MIN_FRAME_SIZE 52 /* Frames must be padded to this size for some A0 chips */ -extern char bnxt_driver_version[]; +extern const char bnxt_driver_version[]; typedef void (*bnxt_doorbell_tx)(void *, uint16_t idx); typedef void (*bnxt_doorbell_rx)(void *, uint16_t idx); typedef void (*bnxt_doorbell_rx_cq)(void *, bool); diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index c77be218e677..2796eed94e11 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -67,7 +67,7 @@ * PCI Device ID Table */ -static pci_vendor_info_t bnxt_vendor_info_array[] = +static const pci_vendor_info_t bnxt_vendor_info_array[] = { PVID(BROADCOM_VENDOR_ID, BCM57301, "Broadcom BCM57301 NetXtreme-C 10Gb Ethernet Controller"), @@ -300,7 +300,7 @@ static driver_t bnxt_iflib_driver = { */ #define BNXT_DRIVER_VERSION "2.20.0.1" -char bnxt_driver_version[] = BNXT_DRIVER_VERSION; +const char bnxt_driver_version[] = BNXT_DRIVER_VERSION; extern struct if_txrx bnxt_txrx; static struct if_shared_ctx bnxt_sctx_init = { .isc_magic = IFLIB_MAGIC, diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index aabd1242b74c..4fa275f08e28 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -36,8 +36,8 @@ /********************************************************************* * Driver version: *********************************************************************/ -char em_driver_version[] = "7.7.8-fbsd"; -char igb_driver_version[] = "2.5.19-fbsd"; +static const char em_driver_version[] = "7.7.8-fbsd"; +static const char igb_driver_version[] = "2.5.19-fbsd"; /********************************************************************* * PCI Device ID Table @@ -49,7 +49,7 @@ char igb_driver_version[] = "2.5.19-fbsd"; * { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index } *********************************************************************/ -static pci_vendor_info_t em_vendor_info_array[] = +static const pci_vendor_info_t em_vendor_info_array[] = { /* Intel(R) - lem-class legacy devices */ PVID(0x8086, E1000_DEV_ID_82540EM, "Intel(R) Legacy PRO/1000 MT 82540EM"), @@ -214,7 +214,7 @@ static pci_vendor_info_t em_vendor_info_array[] = PVID_END }; -static pci_vendor_info_t igb_vendor_info_array[] = +static const pci_vendor_info_t igb_vendor_info_array[] = { /* Intel(R) - igb-class devices */ PVID(0x8086, E1000_DEV_ID_82575EB_COPPER, "Intel(R) PRO/1000 82575EB (Copper)"), diff --git a/sys/dev/enetc/if_enetc.c b/sys/dev/enetc/if_enetc.c index 2924a8e19f86..04171698cd38 100644 --- a/sys/dev/enetc/if_enetc.c +++ b/sys/dev/enetc/if_enetc.c @@ -125,7 +125,7 @@ static int enetc_ctrl_send(struct enetc_softc*, static const char enetc_driver_version[] = "1.0.0"; -static pci_vendor_info_t enetc_vendor_info_array[] = { +static const pci_vendor_info_t enetc_vendor_info_array[] = { PVID(PCI_VENDOR_FREESCALE, ENETC_DEV_ID_PF, "Freescale ENETC PCIe Gigabit Ethernet Controller"), PVID_END diff --git a/sys/dev/enic/if_enic.c b/sys/dev/enic/if_enic.c index a386191a51ef..b2fc3af56006 100644 --- a/sys/dev/enic/if_enic.c +++ b/sys/dev/enic/if_enic.c @@ -57,7 +57,7 @@ static SYSCTL_NODE(_hw, OID_AUTO, enic, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "ENIC"); -static pci_vendor_info_t enic_vendor_info_array[] = +static const pci_vendor_info_t enic_vendor_info_array[] = { PVID(CISCO_VENDOR_ID, PCI_DEVICE_ID_CISCO_VIC_ENET, DRV_DESCRIPTION), diff --git a/sys/dev/iavf/iavf_drv_info.h b/sys/dev/iavf/iavf_drv_info.h index ed8e05fe9727..5a84a30662a8 100644 --- a/sys/dev/iavf/iavf_drv_info.h +++ b/sys/dev/iavf/iavf_drv_info.h @@ -66,7 +66,7 @@ const char iavf_driver_version[] = "3.0.26-k"; * to most-generic entry; e.g. PVIDV_OEM()s for a device ID must come before * the PVIDV() for it. */ -static pci_vendor_info_t iavf_vendor_info_array[] = { +static const pci_vendor_info_t iavf_vendor_info_array[] = { PVIDV(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_VF, "Intel(R) Ethernet Virtual Function 700 Series"), PVIDV(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_X722_VF, diff --git a/sys/dev/ice/ice_drv_info.h b/sys/dev/ice/ice_drv_info.h index f258650760bc..41598923dc94 100644 --- a/sys/dev/ice/ice_drv_info.h +++ b/sys/dev/ice/ice_drv_info.h @@ -85,7 +85,7 @@ const uint8_t ice_rc_version = 0; * to most-generic entry; e.g. PVIDV_OEM()s for a device ID must come before * the PVIDV() for it. */ -static pci_vendor_info_t ice_vendor_info_array[] = { +static const pci_vendor_info_t ice_vendor_info_array[] = { PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_BACKPLANE, "Intel(R) Ethernet Controller E810-C for backplane"), PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_QSFP, diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index 03c366207ff0..c59e379ca2c8 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -46,7 +46,7 @@ * { Vendor ID, Device ID, String } *********************************************************************/ -static pci_vendor_info_t igc_vendor_info_array[] = +static const pci_vendor_info_t igc_vendor_info_array[] = { /* Intel(R) PRO/1000 Network Connection - igc */ PVID(0x8086, IGC_DEV_ID_I225_LM, "Intel(R) Ethernet Controller I225-LM"), diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index ea705d427b86..e8fb5de493ce 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -45,7 +45,7 @@ /************************************************************************ * Driver version ************************************************************************/ -char ixgbe_driver_version[] = "4.0.1-k"; +static const char ixgbe_driver_version[] = "4.0.1-k"; /************************************************************************ * PCI Device ID Table @@ -56,7 +56,7 @@ char ixgbe_driver_version[] = "4.0.1-k"; * * { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index } ************************************************************************/ -static pci_vendor_info_t ixgbe_vendor_info_array[] = +static const pci_vendor_info_t ixgbe_vendor_info_array[] = { PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_DUAL_PORT, "Intel(R) 82598EB AF (Dual Fiber)"), PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_SINGLE_PORT, "Intel(R) 82598EB AF (Fiber)"), diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index 1e902df0510a..66a1e4fe2df1 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -45,7 +45,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 @@ -56,7 +56,7 @@ char ixv_driver_version[] = "2.0.1-k"; * * { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index } ************************************************************************/ -static pci_vendor_info_t ixv_vendor_info_array[] = +static const pci_vendor_info_t ixv_vendor_info_array[] = { PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_VF, "Intel(R) X520 82599 Virtual Function"), PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540_VF, "Intel(R) X540 Virtual Function"), diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index a1dfe523893e..60e66aeaf579 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -63,7 +63,7 @@ * ( Vendor ID, Device ID, Branding String ) *********************************************************************/ -static pci_vendor_info_t ixl_vendor_info_array[] = +static const pci_vendor_info_t ixl_vendor_info_array[] = { PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710, "Intel(R) Ethernet Controller X710 for 10GbE SFP+"), PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B, "Intel(R) Ethernet Controller XL710 for 40GbE backplane"), diff --git a/sys/dev/mgb/if_mgb.c b/sys/dev/mgb/if_mgb.c index 60d0c21ccceb..4a23ef3cdcaf 100644 --- a/sys/dev/mgb/if_mgb.c +++ b/sys/dev/mgb/if_mgb.c @@ -86,7 +86,7 @@ #include "ifdi_if.h" #include "miibus_if.h" -static pci_vendor_info_t mgb_vendor_info_array[] = { +static const pci_vendor_info_t mgb_vendor_info_array[] = { PVID(MGB_MICROCHIP_VENDOR_ID, MGB_LAN7430_DEVICE_ID, "Microchip LAN7430 PCIe Gigabit Ethernet Controller"), PVID(MGB_MICROCHIP_VENDOR_ID, MGB_LAN7431_DEVICE_ID, diff --git a/sys/dev/vmware/vmxnet3/if_vmx.c b/sys/dev/vmware/vmxnet3/if_vmx.c index c819f3aae995..99e84e744d57 100644 --- a/sys/dev/vmware/vmxnet3/if_vmx.c +++ b/sys/dev/vmware/vmxnet3/if_vmx.c @@ -77,7 +77,7 @@ #define VMXNET3_VMWARE_VENDOR_ID 0x15AD #define VMXNET3_VMWARE_DEVICE_ID 0x07B0 -static pci_vendor_info_t vmxnet3_vendor_info_array[] = +static const pci_vendor_info_t vmxnet3_vendor_info_array[] = { PVID(VMXNET3_VMWARE_VENDOR_ID, VMXNET3_VMWARE_DEVICE_ID, "VMware VMXNET3 Ethernet Adapter"), /* required last entry */