aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/module.h
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2023-02-04 05:44:46 +0000
committerLuis Chamberlain <mcgrof@kernel.org>2023-03-09 12:55:15 -0800
commit042edf1ebb49a63f299c4cdfb9c1e2ba299c0b91 (patch)
tree82a65ba20c305d774b164f8eb196ff1b89b2fac5 /include/linux/module.h
parentefaa2496bae66f0a78efa60d9b73ceef5ec63d79 (diff)
downloadlinux-042edf1ebb49a63f299c4cdfb9c1e2ba299c0b91.tar.gz
module: make module_ktype 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 <linux@weissschuh.net> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'include/linux/module.h')
-rw-r--r--include/linux/module.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index c0593a96e158fc..dbc9124b71bcf8 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -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)