Re: [PATCH v5 11/13] module: Move sysfs support into a separate file

From: Aaron Tomlin
Date: Sun Feb 13 2022 - 08:37:29 EST


On Thu 2022-02-10 14:00 +0000, Christophe Leroy wrote:
> Checkpatch:
>
> total: 0 errors, 2 warnings, 10 checks, 946 lines checked

Ok.

> > diff --git a/kernel/module/internal.h b/kernel/module/internal.h
> > index b67ce836746a..52d30bf6d6b0 100644
> > --- a/kernel/module/internal.h
> > +++ b/kernel/module/internal.h
> > @@ -35,6 +35,9 @@
> > extern struct mutex module_mutex;
> > extern struct list_head modules;
> >
> > +extern struct module_attribute *modinfo_attrs[];
> > +extern size_t modinfo_attrs_count;
>
> Can't this come in sysfs.c as well ?

No.

> > +#ifdef CONFIG_SYSFS
> > +int mod_sysfs_setup(struct module *mod, const struct load_info *info,
> > + struct kernel_param *kparam, unsigned int num_params);
> > +void mod_sysfs_fini(struct module *mod);
> > +void module_remove_modinfo_attrs(struct module *mod, int end);
> > +void del_usage_links(struct module *mod);
> > +void init_param_lock(struct module *mod);
>
> Why don't we move mod_sysfs_teardown() here as well ?

Agreed.


Kind regards,

--
Aaron Tomlin