linux-yocto/arch/riscv/kernel
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
..
compat_vdso Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
pi riscv: Do not use fortify in early code 2024-10-25 06:18:36 -07:00
probes riscv: kprobes: Fix incorrect address calculation 2025-01-08 10:39:39 -08:00
tests treewide: replace or remove redundant def_bool in Kconfig files 2024-02-20 20:47:45 +09:00
vdso RISC-V Paches for the 6.13 Merge Window, Part 1 2024-11-27 11:19:09 -08:00
vendor_extensions riscv: Make riscv_isa_vendor_ext_andes array static 2024-09-17 08:05:08 -07:00
.gitignore
acpi_numa.c ACPI: NUMA: initialize all values of acpi_early_node_map to NUMA_NO_NODE 2024-09-20 01:31:26 -07:00
acpi.c RISC-V: ACPI: fix early_ioremap to early_memremap 2024-10-25 06:18:31 -07:00
alternative.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
asm-offsets.c ftrace updates for v6.13: 2024-11-20 11:34:10 -08:00
cacheinfo.c riscv: Prevent a bad reference count on CPU nodes 2024-10-25 06:18:39 -07:00
cfi.c bpf, riscv64/cfi: Support kCFI + BPF on riscv64 2024-03-06 15:18:16 -08:00
compat_signal.c riscv: compat: signal: Add rt_frame implementation 2022-05-17 16:37:21 -07:00
compat_syscall_table.c riscv: convert to generic syscall table 2024-07-10 14:23:38 +02:00
copy-unaligned.h RISC-V: Report vector unaligned access speed hwprobe 2024-10-18 12:38:34 -07:00
copy-unaligned.S riscv: Use SYM_*() assembly macros instead of deprecated ones 2023-11-06 09:42:47 -08:00
cpu_ops_sbi.c riscv: prevent pt_regs corruption for secondary idle threads 2024-05-30 09:42:51 -07:00
cpu_ops_spinwait.c riscv: prevent pt_regs corruption for secondary idle threads 2024-05-30 09:42:51 -07:00
cpu_ops.c riscv: Use the same CPU operations for all CPUs 2024-01-04 15:03:07 -08:00
cpu-hotplug.c riscv: Use '%u' to format the output of 'cpu' 2024-10-25 06:18:40 -07:00
cpu.c riscv: Add vendor extensions to /proc/cpuinfo 2024-07-22 15:36:55 -07:00
cpufeature.c ARM: 2024-11-30 14:51:08 -08:00
crash_dump.c vmcore: convert copy_oldmem_page() to take an iov_iter 2022-04-29 14:37:59 -07:00
crash_save_regs.S RISC-V: Fixup get incorrect user mode PC for kernel mode regs 2022-08-11 08:54:40 -07:00
efi-header.S riscv: efi: Set NX compat flag in PE/COFF header 2024-10-25 06:18:38 -07:00
efi.c riscv: Use accessors to page table entries instead of direct dereference 2023-12-20 10:48:15 -08:00
elf_kexec.c riscv/kexec_file: Fix relocation type R_RISCV_ADD16 and R_RISCV_SUB16 unknown 2024-08-14 17:44:33 -07:00
entry.S riscv: use local label names instead of global ones in assembly 2025-01-08 10:46:14 -08:00
fpu.S RISC-V: Replace RISCV_MISALIGNED with RISCV_SCALAR_MISALIGNED 2024-10-18 12:38:32 -07:00
ftrace.c fgraph: Pass ftrace_regs to entryfunc 2024-12-26 10:50:02 -05:00
head.h riscv: entry: Convert to generic entry 2023-03-23 08:47:00 -07:00
head.S riscv: set trap vector earlier 2024-07-12 08:55:31 -07:00
hibernate-asm.S riscv: Use SYM_*() assembly macros instead of deprecated ones 2023-11-06 09:42:47 -08:00
hibernate.c riscv: hibernate: remove WARN_ON in save_processor_state 2023-06-23 10:06:22 -07:00
image-vars.h efi: move screen_info into efi init code 2023-10-17 16:33:39 +02:00
irq.c Merge patch "drivers: perf: Do not broadcast to other cpus when starting a counter" 2023-11-09 06:44:13 -08:00
jump_label.c riscv: Fixup boot failure when CONFIG_DEBUG_RT_MUTEXES=y 2024-12-11 11:43:39 -08:00
kernel_mode_fpu.c riscv: add support for kernel-mode FPU 2024-05-19 14:36:19 -07:00
kernel_mode_vector.c riscv: vector: allow kernel-mode Vector with preemption 2024-01-16 07:14:02 -08:00
kexec_relocate.S riscv: kexec: Cleanup riscv_kexec_relocate 2023-09-20 02:53:29 -07:00
kgdb.c RISC-V: rename parse_asm.h to insn.h 2022-12-29 06:59:47 -08:00
machine_kexec_file.c RISC-V: Add kexec_file support 2022-05-19 12:14:18 -07:00
machine_kexec.c kexec: Consolidate machine_kexec_mask_interrupts() implementation 2024-12-11 20:32:34 +01:00
Makefile RISC-V Paches for the 6.13 Merge Window, Part 1 2024-11-27 11:19:09 -08:00
Makefile.syscalls syscalls: fix syscall macros for newfstat/newfstatat 2024-08-02 15:20:47 +02:00
mcount-dyn.S ftrace: riscv: move from REGS to ARGS 2024-05-22 16:12:48 -07:00
mcount.S fgraph: Replace fgraph_ret_regs with ftrace_regs 2024-12-26 10:50:02 -05:00
module-sections.c
module.c riscv: module: remove relocation_head rel_entry member allocation 2025-01-08 10:22:52 -08:00
paravirt.c RISC-V: KVM: Rename the SBI_STA_SHMEM_DISABLE to a generic name 2024-04-22 11:13:52 +05:30
patch.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
perf_callchain.c The biggest change here is eliminating the awful idea that KVM had, of 2024-11-23 16:00:50 -08:00
perf_regs.c
process.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
ptrace.c riscv: Allow ptrace control of the tagged address ABI 2024-10-24 14:12:57 -07:00
reset.c riscv: Use do_kernel_power_off() 2022-05-19 19:30:30 +02:00
return_address.c riscv: add CALLER_ADDRx support 2024-02-22 12:17:47 -08:00
riscv_ksyms.c riscv: Omit optimized string routines when using KASAN 2024-09-19 01:10:00 -07:00
sbi_ecall.c riscv: Fix RISCV_ALTERNATIVE_EARLY 2024-09-03 07:57:55 -07:00
sbi-ipi.c RISC-V: Enable the IPI before workqueue_online_cpu() 2024-08-01 07:15:43 -07:00
sbi.c riscv: Fix RISCV_ALTERNATIVE_EARLY 2024-09-03 07:57:55 -07:00
setup.c mm/memblock: add memblock_alloc_or_panic interface 2025-01-25 20:22:38 -08:00
signal.c riscv: signal: Remove unlikely() from WARN_ON() condition 2024-07-26 05:50:46 -07:00
smp.c riscv: export __cpuid_to_hartid_map 2025-01-20 10:25:11 -06:00
smpboot.c riscv: Call riscv_user_isa_enable() only on the boot hart 2024-10-05 08:51:15 -07:00
soc.c
stacktrace.c riscv: stacktrace: fix backtracing through exceptions 2025-01-08 10:45:49 -08:00
suspend_entry.S riscv: Use SYM_*() assembly macros instead of deprecated ones 2023-11-06 09:42:47 -08:00
suspend.c riscv: Enable cbo.zero only when all harts support Zicboz 2024-10-05 08:51:13 -07:00
sys_hwprobe.c RISC-V Paches for the 6.13 Merge Window, Part 1 2024-11-27 11:19:09 -08:00
sys_riscv.c syscalls: mmap(): use unsigned offset type consistently 2024-06-25 15:57:38 +02:00
syscall_table.c riscv: convert to generic syscall table 2024-07-10 14:23:38 +02:00
time.c RISC-V: paravirt: Add skeleton for pv-time support 2023-12-30 11:25:03 +05:30
traps_misaligned.c RISC-V Paches for the 6.13 Merge Window, Part 1 2024-11-27 11:19:09 -08:00
traps.c riscv: Fix sleeping in invalid context in die() 2025-01-08 10:23:17 -08:00
unaligned_access_speed.c RISC-V: Report vector unaligned access speed hwprobe 2024-10-18 12:38:34 -07:00
vdso.c riscv: vdso: Use only one single vvar mapping 2024-11-02 12:37:33 +01:00
vec-copy-unaligned.S RISC-V: Report vector unaligned access speed hwprobe 2024-10-18 12:38:34 -07:00
vector.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
vendor_extensions.c riscv: Fix out-of-bounds when accessing Andes per hart vendor extension array 2024-08-15 13:12:16 -07:00
vmcore_info.c riscv: don't export va_kernel_pa_offset in vmcoreinfo for XIP kernel 2024-09-12 07:22:56 -07:00
vmlinux-xip.lds.S riscv: remove limit on the size of read-only section for XIP kernel 2024-09-12 07:23:02 -07:00
vmlinux.lds.S riscv: Check if the code to patch lies in the exit section 2024-01-09 10:58:59 -08:00