-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
treewide: const qualify ctl_tables where applicable #8338
Conversation
Upstream branch: e8ec1c9 |
Upstream branch: e8ec1c9 |
584cdc2
to
cb25711
Compare
Upstream branch: e8ec1c9 |
cb25711
to
174eb6e
Compare
Upstream branch: e8ec1c9 |
174eb6e
to
5c3cbb2
Compare
Upstream branch: e8ec1c9 |
5c3cbb2
to
652721a
Compare
Upstream branch: e8ec1c9 |
652721a
to
af2cffd
Compare
Add the const qualifier to all the ctl_tables in the tree except the ones in ./net dir. The "net" sysctl code is special as it modifies the arrays before passing it on to the registration function. Constifying ctl_table structs will prevent the modification of proc_handler function pointers as the arrays would reside in .rodata. This is made possible after commit 78eb4ea ("sysctl: treewide: constify the ctl_table argument of proc_handlers") constified all the proc_handlers. Created this by running an spatch followed by a sed command: Spatch: virtual patch @ depends on !(file in "net") disable optional_qualifier @ identifier table_name; @@ + const struct ctl_table table_name [] = { ... }; sed: sed --in-place \ -e "s/struct ctl_table .table = &uts_kern/const struct ctl_table *table = \&uts_kern/" \ kernel/utsname_sysctl.c Signed-off-by: Joel Granados <[email protected]> Acked-by: Steven Rostedt (Google) <[email protected]> # for kernel/trace/ Acked-by: Jani Nikula <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> # SCSI Acked-by: Corey Minyard <[email protected]> Reviewed-by: "Darrick J. Wong" <[email protected]> # xfs Reviewed-by: Song Liu <[email protected]>
Upstream branch: e8ec1c9 |
af2cffd
to
fab17d8
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=923743 irrelevant now. Closing PR. |
Pull request for series with
subject: treewide: const qualify ctl_tables where applicable
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=923743