]> Git Repo - linux.git/commitdiff
cpufreq: Make kobj_type structure constant
authorThomas Weißschuh <[email protected]>
Tue, 7 Feb 2023 19:58:18 +0000 (19:58 +0000)
committerRafael J. Wysocki <[email protected]>
Thu, 9 Feb 2023 19:29:32 +0000 (20:29 +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 definition to prevent
modification at runtime.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/cpufreq/cpufreq.c

index 85a0bea2dbf129417377c1a9cb0221e14e59fcdf..6d8fd3b8dcb526d8dbab3fed2bd5bc218cc95a1b 100644 (file)
@@ -993,7 +993,7 @@ static const struct sysfs_ops sysfs_ops = {
        .store  = store,
 };
 
-static struct kobj_type ktype_cpufreq = {
+static const struct kobj_type ktype_cpufreq = {
        .sysfs_ops      = &sysfs_ops,
        .default_groups = cpufreq_groups,
        .release        = cpufreq_sysfs_release,
This page took 0.052958 seconds and 4 git commands to generate.