]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
platform/chrome: Constify static attribute_group structs
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Sat, 9 Jan 2021 00:17:48 +0000 (01:17 +0100)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>
Wed, 20 Jan 2021 15:19:17 +0000 (16:19 +0100)
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 <rikard.falkeborn@gmail.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20210109001748.58036-1-rikard.falkeborn@gmail.com
drivers/platform/chrome/cros_ec_lightbar.c
drivers/platform/chrome/cros_ec_sysfs.c
drivers/platform/chrome/cros_ec_vbc.c
drivers/platform/chrome/wilco_ec/sysfs.c

index de8dfb12e48633f17b85ece80689bcdceed970bb..469dfc7a4a0302bc5e7af4bd3fbd59a54c0f5ecf 100644 (file)
@@ -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,
 };
index f521a5c650917c12c3515a35ed2872bedd750cd3..fc8681f80abafc44a4e7ed0df7b860040f1db821 100644 (file)
@@ -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,
 };
index f3a70a312b438f5be463281907e385a637d8fa1a..c859c862d7ac55bc7e49612ed09ccc78f17d565e 100644 (file)
@@ -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,
 };
index 3c587b4054a54bafda05669558e7899382db8ed8..79a5e8fa680f2a3498ba20a174b4de4ae1272181 100644 (file)
@@ -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,
 };