From: Rikard Falkeborn Date: Sat, 9 Jan 2021 00:17:48 +0000 (+0100) Subject: platform/chrome: Constify static attribute_group structs X-Git-Tag: v5.12-rc1~112^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d7c1fef7fdc769ee45771059da823c8840590472;p=thirdparty%2Fkernel%2Flinux.git platform/chrome: Constify static attribute_group structs The only usage of these is to print their name in a dev_err-message, and to pass their address to sysfs_create_group() and sysfs_remove_group(), both which takes pointers to const. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn Signed-off-by: Enric Balletbo i Serra Link: https://lore.kernel.org/r/20210109001748.58036-1-rikard.falkeborn@gmail.com --- diff --git a/drivers/platform/chrome/cros_ec_lightbar.c b/drivers/platform/chrome/cros_ec_lightbar.c index de8dfb12e4863..469dfc7a4a030 100644 --- a/drivers/platform/chrome/cros_ec_lightbar.c +++ b/drivers/platform/chrome/cros_ec_lightbar.c @@ -523,7 +523,7 @@ static struct attribute *__lb_cmds_attrs[] = { NULL, }; -static struct attribute_group cros_ec_lightbar_attr_group = { +static const struct attribute_group cros_ec_lightbar_attr_group = { .name = "lightbar", .attrs = __lb_cmds_attrs, }; diff --git a/drivers/platform/chrome/cros_ec_sysfs.c b/drivers/platform/chrome/cros_ec_sysfs.c index f521a5c650917..fc8681f80abaf 100644 --- a/drivers/platform/chrome/cros_ec_sysfs.c +++ b/drivers/platform/chrome/cros_ec_sysfs.c @@ -329,7 +329,7 @@ static umode_t cros_ec_ctrl_visible(struct kobject *kobj, return a->mode; } -static struct attribute_group cros_ec_attr_group = { +static const struct attribute_group cros_ec_attr_group = { .attrs = __ec_attrs, .is_visible = cros_ec_ctrl_visible, }; diff --git a/drivers/platform/chrome/cros_ec_vbc.c b/drivers/platform/chrome/cros_ec_vbc.c index f3a70a312b438..c859c862d7ac5 100644 --- a/drivers/platform/chrome/cros_ec_vbc.c +++ b/drivers/platform/chrome/cros_ec_vbc.c @@ -101,7 +101,7 @@ static struct bin_attribute *cros_ec_vbc_bin_attrs[] = { NULL }; -static struct attribute_group cros_ec_vbc_attr_group = { +static const struct attribute_group cros_ec_vbc_attr_group = { .name = "vbc", .bin_attrs = cros_ec_vbc_bin_attrs, }; diff --git a/drivers/platform/chrome/wilco_ec/sysfs.c b/drivers/platform/chrome/wilco_ec/sysfs.c index 3c587b4054a54..79a5e8fa680f2 100644 --- a/drivers/platform/chrome/wilco_ec/sysfs.c +++ b/drivers/platform/chrome/wilco_ec/sysfs.c @@ -236,7 +236,7 @@ static struct attribute *wilco_dev_attrs[] = { NULL, }; -static struct attribute_group wilco_dev_attr_group = { +static const struct attribute_group wilco_dev_attr_group = { .attrs = wilco_dev_attrs, };