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/sysfs.c | |
| 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/sysfs.c')
| -rw-r--r-- | kernel/module/sysfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/module/sysfs.c b/kernel/module/sysfs.c index 456358e1fdc4..31e7f3055407 100644 --- a/kernel/module/sysfs.c +++ b/kernel/module/sysfs.c @@ -275,7 +275,7 @@ static int add_usage_links(struct module *mod) static void module_remove_modinfo_attrs(struct module *mod, int end) { - struct module_attribute *attr; + const struct module_attribute *attr; int i; for (i = 0; (attr = &mod->modinfo_attrs[i]); i++) { @@ -293,7 +293,7 @@ static void module_remove_modinfo_attrs(struct module *mod, int end) static int module_add_modinfo_attrs(struct module *mod) { - struct module_attribute *attr; + const struct module_attribute *attr; struct module_attribute *temp_attr; int error = 0; int i; |
