Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec6cc599 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller
Browse files

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: default avatarStephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 737aec57
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -508,7 +508,7 @@ static ssize_t phys_switch_id_show(struct device *dev,
}
}
static DEVICE_ATTR_RO(phys_switch_id);
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_netdev_group.attr,
	&dev_attr_type.attr,
	&dev_attr_type.attr,
	&dev_attr_dev_id.attr,
	&dev_attr_dev_id.attr,
@@ -597,7 +597,7 @@ NETSTAT_ENTRY(rx_compressed);
NETSTAT_ENTRY(tx_compressed);
NETSTAT_ENTRY(tx_compressed);
NETSTAT_ENTRY(rx_nohandler);
NETSTAT_ENTRY(rx_nohandler);


static struct attribute *netstat_attrs[] = {
static struct attribute *netstat_attrs[] __ro_after_init = {
	&dev_attr_rx_packets.attr,
	&dev_attr_rx_packets.attr,
	&dev_attr_tx_packets.attr,
	&dev_attr_tx_packets.attr,
	&dev_attr_rx_bytes.attr,
	&dev_attr_rx_bytes.attr,