Skip to content

Commit e898b07

Browse files
t-8chrafaeljw
authored andcommitted
cpuidle: sysfs: 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 7787943 commit e898b07

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/cpuidle/sysfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ static void cpuidle_sysfs_release(struct kobject *kobj)
200200
complete(&kdev->kobj_unregister);
201201
}
202202

203-
static struct kobj_type ktype_cpuidle = {
203+
static const struct kobj_type ktype_cpuidle = {
204204
.sysfs_ops = &cpuidle_sysfs_ops,
205205
.release = cpuidle_sysfs_release,
206206
};
@@ -447,7 +447,7 @@ static void cpuidle_state_sysfs_release(struct kobject *kobj)
447447
complete(&state_obj->kobj_unregister);
448448
}
449449

450-
static struct kobj_type ktype_state_cpuidle = {
450+
static const struct kobj_type ktype_state_cpuidle = {
451451
.sysfs_ops = &cpuidle_state_sysfs_ops,
452452
.default_groups = cpuidle_state_default_groups,
453453
.release = cpuidle_state_sysfs_release,
@@ -594,7 +594,7 @@ static struct attribute *cpuidle_driver_default_attrs[] = {
594594
};
595595
ATTRIBUTE_GROUPS(cpuidle_driver_default);
596596

597-
static struct kobj_type ktype_driver_cpuidle = {
597+
static const struct kobj_type ktype_driver_cpuidle = {
598598
.sysfs_ops = &cpuidle_driver_sysfs_ops,
599599
.default_groups = cpuidle_driver_default_groups,
600600
.release = cpuidle_driver_sysfs_release,

0 commit comments

Comments
 (0)