ACPI: make kobj_type structures constant
authorThomas Weißschuh <linux@weissschuh.net>
Tue, 14 Feb 2023 03:23:52 +0000 (03:23 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 14 Feb 2023 14:52:37 +0000 (15:52 +0100)
Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.")
the driver core allows the usage of const struct kobj_type.

Take advantage of this to constify the structure definitions to prevent
modification at runtime.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/cppc_acpi.c
drivers/acpi/device_sysfs.c
drivers/acpi/sysfs.c

index 0f17b1c32718edb3d0f8c48597c54bbc6fc5f2f3..a8f58b32d66f2a9988658178fd31a15c88979894 100644 (file)
@@ -193,7 +193,7 @@ static struct attribute *cppc_attrs[] = {
 };
 ATTRIBUTE_GROUPS(cppc);
 
-static struct kobj_type cppc_ktype = {
+static const struct kobj_type cppc_ktype = {
        .sysfs_ops = &kobj_sysfs_ops,
        .default_groups = cppc_groups,
 };
index 120873dad2cc56addea2edad6135a2d055a848f9..c3aa15571f164ef8dc8cfe120cd2294a28890726 100644 (file)
@@ -78,7 +78,7 @@ static void acpi_data_node_release(struct kobject *kobj)
        complete(&dn->kobj_done);
 }
 
-static struct kobj_type acpi_data_node_ktype = {
+static const struct kobj_type acpi_data_node_ktype = {
        .sysfs_ops = &acpi_data_node_sysfs_ops,
        .default_groups = acpi_data_node_default_groups,
        .release = acpi_data_node_release,
index 7db3b530279bd531d6a1c31705a648bb9ad51ab4..7f4ff56c9d4260ad5deadd146b9759d32d7d4615 100644 (file)
@@ -953,7 +953,7 @@ static struct attribute *hotplug_profile_attrs[] = {
 };
 ATTRIBUTE_GROUPS(hotplug_profile);
 
-static struct kobj_type acpi_hotplug_profile_ktype = {
+static const struct kobj_type acpi_hotplug_profile_ktype = {
        .sysfs_ops = &kobj_sysfs_ops,
        .default_groups = hotplug_profile_groups,
 };