diff options
author | Rikard Falkeborn <rikard.falkeborn@gmail.com> | 2020-11-25 19:24:58 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-11-26 15:40:42 +0300 |
commit | 4154a4f70a9488212f8731770e10eae957d33da9 (patch) | |
tree | 4cd6f87dead07b766b15f5e61705a90860e9a625 /drivers/usb/core/sysfs.c | |
parent | 11e5e568ceed7c8c570313a14fa96c72f21dad31 (diff) | |
download | linux-4154a4f70a9488212f8731770e10eae957d33da9.tar.xz |
USB: core: Constify static attribute_group structs
These are never modified, so make them const to allow the compiler to
put them in read-only memory. Done with the help of coccinelle.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20201125162500.37228-2-rikard.falkeborn@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/sysfs.c')
-rw-r--r-- | drivers/usb/core/sysfs.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index 8d134193fa0c..d85699bee671 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c @@ -641,7 +641,7 @@ static struct attribute *usb2_hardware_lpm_attr[] = { &dev_attr_usb2_lpm_besl.attr, NULL, }; -static struct attribute_group usb2_hardware_lpm_attr_group = { +static const struct attribute_group usb2_hardware_lpm_attr_group = { .name = power_group_name, .attrs = usb2_hardware_lpm_attr, }; @@ -651,7 +651,7 @@ static struct attribute *usb3_hardware_lpm_attr[] = { &dev_attr_usb3_hardware_lpm_u2.attr, NULL, }; -static struct attribute_group usb3_hardware_lpm_attr_group = { +static const struct attribute_group usb3_hardware_lpm_attr_group = { .name = power_group_name, .attrs = usb3_hardware_lpm_attr, }; @@ -663,7 +663,7 @@ static struct attribute *power_attrs[] = { &dev_attr_active_duration.attr, NULL, }; -static struct attribute_group power_attr_group = { +static const struct attribute_group power_attr_group = { .name = power_group_name, .attrs = power_attrs, }; @@ -832,7 +832,7 @@ static struct attribute *dev_attrs[] = { #endif NULL, }; -static struct attribute_group dev_attr_grp = { +static const struct attribute_group dev_attr_grp = { .attrs = dev_attrs, }; @@ -865,7 +865,7 @@ static umode_t dev_string_attrs_are_visible(struct kobject *kobj, return a->mode; } -static struct attribute_group dev_string_attr_grp = { +static const struct attribute_group dev_string_attr_grp = { .attrs = dev_string_attrs, .is_visible = dev_string_attrs_are_visible, }; @@ -1222,7 +1222,7 @@ static struct attribute *intf_attrs[] = { &dev_attr_interface_authorized.attr, NULL, }; -static struct attribute_group intf_attr_grp = { +static const struct attribute_group intf_attr_grp = { .attrs = intf_attrs, }; @@ -1246,7 +1246,7 @@ static umode_t intf_assoc_attrs_are_visible(struct kobject *kobj, return a->mode; } -static struct attribute_group intf_assoc_attr_grp = { +static const struct attribute_group intf_assoc_attr_grp = { .attrs = intf_assoc_attrs, .is_visible = intf_assoc_attrs_are_visible, }; |