Skip to content

Commit a527b01

Browse files
t-8chrafaeljw
authored andcommitted
ACPI: make kobj_type structures constant
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 446c85a commit a527b01

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

drivers/acpi/cppc_acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static struct attribute *cppc_attrs[] = {
193193
};
194194
ATTRIBUTE_GROUPS(cppc);
195195

196-
static struct kobj_type cppc_ktype = {
196+
static const struct kobj_type cppc_ktype = {
197197
.sysfs_ops = &kobj_sysfs_ops,
198198
.default_groups = cppc_groups,
199199
};

drivers/acpi/device_sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static void acpi_data_node_release(struct kobject *kobj)
7878
complete(&dn->kobj_done);
7979
}
8080

81-
static struct kobj_type acpi_data_node_ktype = {
81+
static const struct kobj_type acpi_data_node_ktype = {
8282
.sysfs_ops = &acpi_data_node_sysfs_ops,
8383
.default_groups = acpi_data_node_default_groups,
8484
.release = acpi_data_node_release,

drivers/acpi/sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ static struct attribute *hotplug_profile_attrs[] = {
953953
};
954954
ATTRIBUTE_GROUPS(hotplug_profile);
955955

956-
static struct kobj_type acpi_hotplug_profile_ktype = {
956+
static const struct kobj_type acpi_hotplug_profile_ktype = {
957957
.sysfs_ops = &kobj_sysfs_ops,
958958
.default_groups = hotplug_profile_groups,
959959
};

0 commit comments

Comments
 (0)