From: Thomas Weißschuh Date: Tue, 7 Feb 2023 19:58:18 +0000 (+0000) Subject: cpufreq: Make kobj_type structure constant X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=108fcad91109bd7e9374ae9d509085f5ec55799b;p=linux.git cpufreq: Make kobj_type structure constant 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 Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 85a0bea2dbf12..6d8fd3b8dcb52 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -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,