summaryrefslogtreecommitdiffstats
path: root/net/core/net-sysfs.c
diff options
context:
space:
mode:
authorstephen hemminger <stephen@networkplumber.org>2017-08-18 13:46:23 -0700
committerDavid S. Miller <davem@davemloft.net>2017-08-18 22:37:35 -0700
commitec6cc5993c0f0c1e5a7cbb630c7ecc165e6d9e84 (patch)
treee52b07b1c35a2fe6eccf83d5037b5195b02bd9ea /net/core/net-sysfs.c
parent737aec57c672c1308d602afecd841455c39561e5 (diff)
downloadlinux-ec6cc5993c0f0c1e5a7cbb630c7ecc165e6d9e84.tar.gz
linux-ec6cc5993c0f0c1e5a7cbb630c7ecc165e6d9e84.tar.bz2
linux-ec6cc5993c0f0c1e5a7cbb630c7ecc165e6d9e84.zip
net: make net sysfs attributes ro_after_init
The attributes of net devices are immutable. Ideally, attribute groups would contain const attributes but there are too many places that do modifications of list during startup (in other code) to allow that. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/net-sysfs.c')
-rw-r--r--net/core/net-sysfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 2de441692f28..76ec74d4a65b 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -508,7 +508,7 @@ static ssize_t phys_switch_id_show(struct device *dev,
}
static DEVICE_ATTR_RO(phys_switch_id);
-static struct attribute *net_class_attrs[] = {
+static struct attribute *net_class_attrs[] __ro_after_init = {
&dev_attr_netdev_group.attr,
&dev_attr_type.attr,
&dev_attr_dev_id.attr,
@@ -597,7 +597,7 @@ NETSTAT_ENTRY(rx_compressed);
NETSTAT_ENTRY(tx_compressed);
NETSTAT_ENTRY(rx_nohandler);
-static struct attribute *netstat_attrs[] = {
+static struct attribute *netstat_attrs[] __ro_after_init = {
&dev_attr_rx_packets.attr,
&dev_attr_tx_packets.attr,
&dev_attr_rx_bytes.attr,