Skip to content

Commit

Permalink
ACPI: make kobj_type structures constant
Browse files Browse the repository at this point in the history
Since commit ee6d3dd ("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>
  • Loading branch information
Thomas Weißschuh authored and Rafael J. Wysocki committed Feb 14, 2023
1 parent 446c85a commit a527b01
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/acpi/cppc_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/device_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down

0 comments on commit a527b01

Please sign in to comment.