Re: [RFC PATCH 11/12] module: Move sysfs support into a separate file
From: Luis Chamberlain
Date: Wed Jan 12 2022 - 11:20:20 EST
On Tue, Dec 28, 2021 at 09:30:40PM +0000, Aaron Tomlin wrote:
> diff --git a/kernel/module/main.c b/kernel/module/main.c
> index 2da580c7b069..354fb2697188 100644
> --- a/kernel/module/main.c
> +++ b/kernel/module/main.c
> @@ -1017,7 +1015,7 @@ static ssize_t show_taint(struct module_attribute *mattr,
> static struct module_attribute modinfo_taint =
> __ATTR(taint, 0444, show_taint, NULL);
>
> -static struct module_attribute *modinfo_attrs[] = {
> +struct module_attribute *modinfo_attrs[] = {
> &module_uevent,
> &modinfo_version,
> &modinfo_srcversion,
> @@ -1031,6 +1029,8 @@ static struct module_attribute *modinfo_attrs[] = {
> NULL,
> };
>
> +size_t modinfo_attrs_count = ARRAY_SIZE(modinfo_attrs);
> +
> static const char vermagic[] = VERMAGIC_STRING;
>
> static int try_to_force_load(struct module *mod, const char *reason)
Can't modinfo_attrs and modinfo_attrs_count be left static and moved to
the new file?
Luis