linux/kernel/sched
Joel Granados 1751f872cc treewide: const qualify ctl_tables where applicable
Add the const qualifier to all the ctl_tables in the tree except for
watchdog_hardlockup_sysctl, memory_allocation_profiling_sysctls,
loadpin_sysctl_table and the ones calling register_net_sysctl (./net,
drivers/inifiniband dirs). These are special cases as they use a
registration function with a non-const qualified ctl_table argument or
modify the arrays before passing them 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 78eb4ea25c ("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 != {
      watchdog_hardlockup_sysctl,
      iwcm_ctl_table,
      ucma_ctl_table,
      memory_allocation_profiling_sysctls,
      loadpin_sysctl_table
    };
    @@

    + 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

Reviewed-by: Song Liu <song@kernel.org>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> # for kernel/trace/
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> # SCSI
Reviewed-by: Darrick J. Wong <djwong@kernel.org> # xfs
Acked-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Corey Minyard <cminyard@mvista.com>
Acked-by: Wei Liu <wei.liu@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
Acked-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Acked-by: Anna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
2025-01-28 13:48:37 +01:00
..
autogroup.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
autogroup.h
build_policy.c sched_ext: Disallow loading BPF scheduler if isolcpus= domain isolation is in effect 2024-07-08 09:30:13 -10:00
build_utility.c sched/headers: Remove duplicate header inclusions 2023-10-03 21:27:55 +02:00
clock.c sched: Fix spelling in comments 2024-05-27 17:00:21 +02:00
completion.c
core.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
core_sched.c sched: Fix spelling in comments 2024-05-27 17:00:21 +02:00
cpuacct.c
cpudeadline.c sched/topology: Consolidate and clean up access to a CPU's max compute capacity 2023-10-09 12:59:48 +02:00
cpudeadline.h
cpufreq.c
cpufreq_schedutil.c Merge branch 'pm-cpufreq' 2025-01-20 20:34:50 +01:00
cpupri.c
cpupri.h
cputime.c sched: Define sched_clock_irqtime as static key 2025-01-13 14:10:25 +01:00
deadline.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
debug.c sched/debug: Change need_resched warnings to pr_err 2025-01-13 14:10:23 +01:00
ext.c sched_ext: Changes for v6.14 2025-01-23 18:49:43 -08:00
ext.h sched_ext: idle: Refresh idle masks during idle-to-idle transitions 2025-01-10 12:40:42 -10:00
fair.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
features.h sched/fair: Untangle NEXT_BUDDY and pick_next_task() 2024-12-09 11:48:13 +01:00
idle.c sched_ext: idle: Refresh idle masks during idle-to-idle transitions 2025-01-10 12:40:42 -10:00
isolation.c sched/isolation: Consolidate housekeeping cpumasks that are always identical 2024-12-02 12:24:28 +01:00
loadavg.c sched: Fix spelling in comments 2024-05-27 17:00:21 +02:00
Makefile
membarrier.c RISC-V Patches for the 6.9 Merge Window 2024-03-22 10:41:13 -07:00
pelt.c sched/fair: Use the new cfs_rq.h_nr_runnable 2024-12-09 11:48:11 +01:00
pelt.h sched: Move update_other_load_avgs() to kernel/sched/pelt.c 2024-09-11 20:00:21 -10:00
psi.c sched, psi: Don't account irq time if sched_clock_irqtime is disabled 2025-01-13 14:10:26 +01:00
rt.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
sched-pelt.h
sched.h sched_ext: Changes for v6.14 2025-01-23 18:49:43 -08:00
smp.h
stats.c docs: Update Schedstat version to 17 2024-12-20 15:31:18 +01:00
stats.h Mainly individually changelogged singleton patches. The patch series in 2025-01-26 17:50:53 -08:00
stop_task.c sched: Add put_prev_task(.next) 2024-09-03 15:26:32 +02:00
swait.c
syscalls.c sched/fair: Encapsulate set custom slice in a __setparam_fair() function 2025-01-13 14:10:22 +01:00
topology.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
wait.c sched: remove wait bookmarks 2023-10-18 14:34:18 -07:00
wait_bit.c sched/wait: Remove unused bit_wait_io_timeout 2024-10-07 09:28:41 +02:00