[PATCH v2 0/6] module: sysfs: Cleanups and preparation for const struct bin_attribute

Thomas Weißschuh posted 6 patches 1 year, 4 months ago
kernel/module/sysfs.c | 116 ++++++++++++++++++++++++--------------------------
1 file changed, 55 insertions(+), 61 deletions(-)
[PATCH v2 0/6] module: sysfs: Cleanups and preparation for const struct bin_attribute
Posted by Thomas Weißschuh 1 year, 4 months ago
The sysfs core is switching to 'const struct bin_attribute's.
Prepare for that.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Changes in v2:
- Avoid NULL-deref in free_sect_attrs()
- Avoid double-free and NULL-deref in free_notes_attrs()
- Also drop 'struct module_sect_attr'
- Link to v1: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-module-v1-0-f81e49e54ce4@weissschuh.net

---
Thomas Weißschuh (6):
      module: sysfs: Drop member 'module_sect_attrs::nsections'
      module: sysfs: Drop member 'module_sect_attr::address'
      module: sysfs: Drop 'struct module_sect_attr'
      module: sysfs: Simplify section attribute allocation
      module: sysfs: Add notes attributes through attribute_group
      module: sysfs: Use const 'struct bin_attribute'

 kernel/module/sysfs.c | 116 ++++++++++++++++++++++++--------------------------
 1 file changed, 55 insertions(+), 61 deletions(-)
---
base-commit: d6ef8b40d075c425f548002d2f35ae3f06e9cf96
change-id: 20241215-sysfs-const-bin_attr-module-be05346937a6

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>

Re: [PATCH v2 0/6] module: sysfs: Cleanups and preparation for const struct bin_attribute
Posted by Petr Pavlu 1 year, 4 months ago
On 12/27/24 14:23, Thomas Weißschuh wrote:
> The sysfs core is switching to 'const struct bin_attribute's.
> Prepare for that.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> Changes in v2:
> - Avoid NULL-deref in free_sect_attrs()
> - Avoid double-free and NULL-deref in free_notes_attrs()
> - Also drop 'struct module_sect_attr'
> - Link to v1: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-module-v1-0-f81e49e54ce4@weissschuh.net
> 
> ---
> Thomas Weißschuh (6):
>       module: sysfs: Drop member 'module_sect_attrs::nsections'
>       module: sysfs: Drop member 'module_sect_attr::address'
>       module: sysfs: Drop 'struct module_sect_attr'
>       module: sysfs: Simplify section attribute allocation
>       module: sysfs: Add notes attributes through attribute_group
>       module: sysfs: Use const 'struct bin_attribute'
> 
>  kernel/module/sysfs.c | 116 ++++++++++++++++++++++++--------------------------
>  1 file changed, 55 insertions(+), 61 deletions(-)
> ---
> base-commit: d6ef8b40d075c425f548002d2f35ae3f06e9cf96
> change-id: 20241215-sysfs-const-bin_attr-module-be05346937a6

Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>

I'm going to wait for a few days if others want to comment and then plan
to queue this on the modules tree for the 6.14 merge window.

-- 
Thanks,
Petr
Re: [PATCH v2 0/6] module: sysfs: Cleanups and preparation for const struct bin_attribute
Posted by Greg KH 1 year, 4 months ago
On Tue, Dec 31, 2024 at 04:07:40PM +0100, Petr Pavlu wrote:
> On 12/27/24 14:23, Thomas Weißschuh wrote:
> > The sysfs core is switching to 'const struct bin_attribute's.
> > Prepare for that.
> > 
> > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> > ---
> > Changes in v2:
> > - Avoid NULL-deref in free_sect_attrs()
> > - Avoid double-free and NULL-deref in free_notes_attrs()
> > - Also drop 'struct module_sect_attr'
> > - Link to v1: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-module-v1-0-f81e49e54ce4@weissschuh.net
> > 
> > ---
> > Thomas Weißschuh (6):
> >       module: sysfs: Drop member 'module_sect_attrs::nsections'
> >       module: sysfs: Drop member 'module_sect_attr::address'
> >       module: sysfs: Drop 'struct module_sect_attr'
> >       module: sysfs: Simplify section attribute allocation
> >       module: sysfs: Add notes attributes through attribute_group
> >       module: sysfs: Use const 'struct bin_attribute'
> > 
> >  kernel/module/sysfs.c | 116 ++++++++++++++++++++++++--------------------------
> >  1 file changed, 55 insertions(+), 61 deletions(-)
> > ---
> > base-commit: d6ef8b40d075c425f548002d2f35ae3f06e9cf96
> > change-id: 20241215-sysfs-const-bin_attr-module-be05346937a6
> 
> Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
> 
> I'm going to wait for a few days if others want to comment and then plan
> to queue this on the modules tree for the 6.14 merge window.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>