diff options
author | Rikard Falkeborn <rikard.falkeborn@gmail.com> | 2020-11-25 17:24:59 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-11-26 13:40:42 +0100 |
commit | 690756a367649a19c5622d135e00799930e7996c (patch) | |
tree | f48d48397006f4fe99d5f9b1f8d63b208da56394 | |
parent | 4154a4f70a9488212f8731770e10eae957d33da9 (diff) | |
download | linux-690756a367649a19c5622d135e00799930e7996c.tar.gz linux-690756a367649a19c5622d135e00799930e7996c.tar.bz2 linux-690756a367649a19c5622d135e00799930e7996c.zip |
usb: typec: 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-3-rikard.falkeborn@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/typec/class.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index df4478baf95b..8f40093c2044 100644 --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -417,7 +417,7 @@ static umode_t typec_altmode_attr_is_visible(struct kobject *kobj, return attr->mode; } -static struct attribute_group typec_altmode_group = { +static const struct attribute_group typec_altmode_group = { .is_visible = typec_altmode_attr_is_visible, .attrs = typec_altmode_attrs, }; @@ -607,7 +607,7 @@ static umode_t typec_partner_attr_is_visible(struct kobject *kobj, struct attrib return attr->mode; } -static struct attribute_group typec_partner_group = { +static const struct attribute_group typec_partner_group = { .is_visible = typec_partner_attr_is_visible, .attrs = typec_partner_attrs }; @@ -789,7 +789,7 @@ static umode_t typec_plug_attr_is_visible(struct kobject *kobj, struct attribute return attr->mode; } -static struct attribute_group typec_plug_group = { +static const struct attribute_group typec_plug_group = { .is_visible = typec_plug_attr_is_visible, .attrs = typec_plug_attrs }; @@ -1479,7 +1479,7 @@ static umode_t typec_attr_is_visible(struct kobject *kobj, return attr->mode; } -static struct attribute_group typec_group = { +static const struct attribute_group typec_group = { .is_visible = typec_attr_is_visible, .attrs = typec_attrs, }; |