thunderbolt: Constify static attribute_group structs
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Fri, 8 Jan 2021 23:09:19 +0000 (00:09 +0100)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 11 Jan 2021 14:13:48 +0000 (17:13 +0300)
The only usage of these is to put their addresses in arrays of pointers
to const attribute_groups. Make them const to allow the compiler to put
them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/domain.c
drivers/thunderbolt/switch.c
drivers/thunderbolt/xdomain.c

index f0de94f7acbf9ff82a13424666f393c7d54a8706..d2b92a8be577599d7dcea3eb3561bd45962382b7 100644 (file)
@@ -289,7 +289,7 @@ static umode_t domain_attr_is_visible(struct kobject *kobj,
        return attr->mode;
 }
 
-static struct attribute_group domain_attr_group = {
+static const struct attribute_group domain_attr_group = {
        .is_visible = domain_attr_is_visible,
        .attrs = domain_attrs,
 };
index a8572f49d3adc42e65998f3cd38e60443ef7ca87..602e1835bf618186feb830d95c32f15a475264d6 100644 (file)
@@ -1771,7 +1771,7 @@ static umode_t switch_attr_is_visible(struct kobject *kobj,
        return sw->safe_mode ? 0 : attr->mode;
 }
 
-static struct attribute_group switch_group = {
+static const struct attribute_group switch_group = {
        .is_visible = switch_attr_is_visible,
        .attrs = switch_attrs,
 };
index 9b3a299a1202316ac9eafe28c821f1af8b26f882..f2d4db1cd84d022a641daaf97454ea7b2cb29ca5 100644 (file)
@@ -756,7 +756,7 @@ static struct attribute *tb_service_attrs[] = {
        NULL,
 };
 
-static struct attribute_group tb_service_attr_group = {
+static const struct attribute_group tb_service_attr_group = {
        .attrs = tb_service_attrs,
 };
 
@@ -1239,7 +1239,7 @@ static struct attribute *xdomain_attrs[] = {
        NULL,
 };
 
-static struct attribute_group xdomain_attr_group = {
+static const struct attribute_group xdomain_attr_group = {
        .attrs = xdomain_attrs,
 };