power: supply: core: Constify static struct attribute_group
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Wed, 13 Jan 2021 20:32:43 +0000 (21:32 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 13 Jan 2021 21:11:44 +0000 (22:11 +0100)
The only usage of it is to put its address in an array of pointers to
const static structs. Make it const to allow the compiler to put it in
read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/power_supply_sysfs.c

index 92dd6317119339a4e5e7fc3d11bdd1e032db13ba..c3d7cbcd4fad518cf07c516034ef5862f16bebb7 100644 (file)
@@ -374,7 +374,7 @@ static umode_t power_supply_attr_is_visible(struct kobject *kobj,
        return 0;
 }
 
-static struct attribute_group power_supply_attr_group = {
+static const struct attribute_group power_supply_attr_group = {
        .attrs = __power_supply_attrs,
        .is_visible = power_supply_attr_is_visible,
 };