Commit 042edf1e authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Luis Chamberlain

module: make module_ktype structure constant

Since commit ee6d3dd4 ("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: default avatarThomas Weißschuh <linux@weissschuh.net>
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
parent efaa2496
......@@ -871,7 +871,7 @@ void *dereference_module_function_descriptor(struct module *mod, void *ptr)
#ifdef CONFIG_SYSFS
extern struct kset *module_kset;
extern struct kobj_type module_ktype;
extern const struct kobj_type module_ktype;
#endif /* CONFIG_SYSFS */
#define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)
......
......@@ -948,7 +948,7 @@ static void module_kobj_release(struct kobject *kobj)
complete(mk->kobj_completion);
}
struct kobj_type module_ktype = {
const struct kobj_type module_ktype = {
.release = module_kobj_release,
.sysfs_ops = &module_sysfs_ops,
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment