lkml.org 
[lkml]   [2024]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 11/11] sysctl: treewide: constify the ctl_table argument of handlers
On Tue, Apr 23, 2024 at 09:54:46AM +0200, Thomas Weißschuh wrote:
> Adapt the proc_hander function signature to make it clear that handlers
> are not supposed to modify their ctl_table argument.
>
> This is a prerequisite to moving the static ctl_table structs into
> rodata.
> By migrating all handlers at once a lengthy transition can be avoided.
>
> The patch was mostly generated by coccinelle with the following script:
>
> @@
> identifier func, ctl, write, buffer, lenp, ppos;
> @@
>
> int func(
> - struct ctl_table *ctl,
> + const struct ctl_table *ctl,
> int write, void *buffer, size_t *lenp, loff_t *ppos)
> { ... }
>
> In addition to the scripted changes some other changes are done:
>
> * the typedef proc_handler is adapted
>
> * the prototypes of non-static handler are adapted
>
> * kernel/seccomp.c:{read,write}_actions_logged() and
> kernel/watchdog.c:proc_watchdog_common() are adapted as they need to
> adapted together with the handlers for type-consistency reasons
>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

..

> arch/s390/appldata/appldata_base.c | 10 ++---
> arch/s390/kernel/debug.c | 2 +-
> arch/s390/kernel/topology.c | 2 +-
> arch/s390/mm/cmm.c | 6 +--

Acked-by: Heiko Carstens <hca@linux.ibm.com> # s390

\
 
 \ /
  Last update: 2024-04-29 11:49    [W:0.019 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site