Skip to content

Commit 38ef00c

Browse files
ArvindYadavCsdavem330
authored andcommitted
net: constify attribute_group structures.
attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by <linux/device.h> work with const attribute_group. So mark the non-const structs as const. File size before: text data bss dec hex filename 9968 3168 16 13152 3360 net/core/net-sysfs.o File size After adding 'const': text data bss dec hex filename 10160 2976 16 13152 3360 net/core/net-sysfs.o Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ee27244 commit 38ef00c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/core/net-sysfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ static struct attribute *netstat_attrs[] = {
626626
};
627627

628628

629-
static struct attribute_group netstat_group = {
629+
static const struct attribute_group netstat_group = {
630630
.name = "statistics",
631631
.attrs = netstat_attrs,
632632
};
@@ -636,7 +636,7 @@ static struct attribute *wireless_attrs[] = {
636636
NULL
637637
};
638638

639-
static struct attribute_group wireless_group = {
639+
static const struct attribute_group wireless_group = {
640640
.name = "wireless",
641641
.attrs = wireless_attrs,
642642
};
@@ -1204,7 +1204,7 @@ static struct attribute *dql_attrs[] = {
12041204
NULL
12051205
};
12061206

1207-
static struct attribute_group dql_group = {
1207+
static const struct attribute_group dql_group = {
12081208
.name = "byte_queue_limits",
12091209
.attrs = dql_attrs,
12101210
};

0 commit comments

Comments
 (0)