diff options
| author | Thomas Weißschuh <linux@weissschuh.net> | 2024-12-16 18:25:10 +0100 |
|---|---|---|
| committer | Petr Pavlu <petr.pavlu@suse.com> | 2025-01-26 13:05:23 +0100 |
| commit | f3227ffda07470848abe3cfa2039b21816ce3090 (patch) | |
| tree | 576fe7369c447a6aa2a7327161ac654333d3337d /kernel/module/internal.h | |
| parent | 38e3fe6595e1fa806c0450b2db666bc46325025e (diff) | |
module: Constify 'struct module_attribute'
These structs are never modified, move them to read-only memory.
This makes the API clearer and also prepares for the constification of
'struct attribute' itself.
While at it, also constify 'modinfo_attrs_count'.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Link: https://lore.kernel.org/r/20241216-sysfs-const-attr-module-v1-3-3790b53e0abf@weissschuh.net
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Diffstat (limited to 'kernel/module/internal.h')
| -rw-r--r-- | kernel/module/internal.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/module/internal.h b/kernel/module/internal.h index daef2be83902..ac73da5f15bc 100644 --- a/kernel/module/internal.h +++ b/kernel/module/internal.h @@ -47,8 +47,8 @@ struct kernel_symbol { extern struct mutex module_mutex; extern struct list_head modules; -extern struct module_attribute *modinfo_attrs[]; -extern size_t modinfo_attrs_count; +extern const struct module_attribute *const modinfo_attrs[]; +extern const size_t modinfo_attrs_count; /* Provided by the linker */ extern const struct kernel_symbol __start___ksymtab[]; |