mbox series

[0/3] module: Constify 'struct module_attribute'

Message ID 20241216-sysfs-const-attr-module-v1-0-3790b53e0abf@weissschuh.net (mailing list archive)
Headers show
Series module: Constify 'struct module_attribute' | expand

Message

Thomas Weißschuh Dec. 16, 2024, 5:25 p.m. UTC
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.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Thomas Weißschuh (3):
      params: Prepare for 'const struct module_attribute *'
      module: Handle 'struct module_version_attribute' as const
      module: Constify 'struct module_attribute'

 include/linux/module.h   | 10 +++++-----
 kernel/module/internal.h |  4 ++--
 kernel/module/main.c     | 40 ++++++++++++++++++++--------------------
 kernel/module/sysfs.c    |  4 ++--
 kernel/params.c          | 22 +++++++++++-----------
 5 files changed, 40 insertions(+), 40 deletions(-)
---
base-commit: 78d4f34e2115b517bcbfe7ec0d018bbbb6f9b0b8
change-id: 20241204-sysfs-const-attr-module-927afe76eda4

Best regards,

Comments

Petr Pavlu Dec. 17, 2024, 5:45 p.m. UTC | #1
On 12/16/24 18:25, Thomas Weißschuh wrote:
> 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.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> Thomas Weißschuh (3):
>       params: Prepare for 'const struct module_attribute *'
>       module: Handle 'struct module_version_attribute' as const
>       module: Constify 'struct module_attribute'
> 
>  include/linux/module.h   | 10 +++++-----
>  kernel/module/internal.h |  4 ++--
>  kernel/module/main.c     | 40 ++++++++++++++++++++--------------------
>  kernel/module/sysfs.c    |  4 ++--
>  kernel/params.c          | 22 +++++++++++-----------
>  5 files changed, 40 insertions(+), 40 deletions(-)
> ---
> base-commit: 78d4f34e2115b517bcbfe7ec0d018bbbb6f9b0b8
> change-id: 20241204-sysfs-const-attr-module-927afe76eda4

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.