linux-yocto/drivers/base
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
..
firmware_loader treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
power PM: sleep: wakeirq: Introduce device-managed variant of dev_pm_set_wake_irq() 2025-01-17 20:27:46 +01:00
regmap Expand SoundWire MBQ register map support 2025-01-07 23:28:07 +00:00
test
arch_numa.c arch_numa: Restore nid checks before registering a memblock with a node 2024-12-01 22:04:52 +02:00
arch_topology.c ACPI: processor: Move arch_init_invariance_cppc() call later 2024-11-06 21:31:36 +01:00
attribute_container.c driver core: attribute_container: Remove unused functions 2024-09-13 15:41:42 +02:00
auxiliary_sysfs.c driver core: auxiliary bus: show auxiliary device IRQs 2024-07-11 14:17:03 -07:00
auxiliary.c driver core: auxiliary bus: Spelling s/pecific/specific/ 2024-11-04 01:58:10 +01:00
base.h Revert "driver core: shut down devices asynchronously" 2024-09-25 11:01:27 +02:00
bus.c drivers/base: Introduce device_match_t for device finding APIs 2024-09-03 12:48:51 +02:00
cacheinfo.c cacheinfo: Allocate memory during CPU hotplug if not done from the primary CPU 2024-12-06 13:07:47 +01:00
class.c driver core: class: Correct WARN() message in APIs class_(for_each|find)_device() 2024-11-12 13:10:43 +01:00
component.c
container.c
core.c Driver core changes for 6.13-rc1 2024-11-29 11:43:29 -08:00
cpu.c Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
dd.c Driver core update for 6.12-rc1 2024-09-27 08:48:37 -07:00
devcoredump.c devcoredump: Add dev_coredumpm_timeout() 2024-06-12 11:29:36 -04:00
devres.c devres: Correclty strip percpu address space of devm_free_percpu() argument 2024-09-03 13:15:21 +02:00
devtmpfs.c
driver.c drivers/base: Introduce device_match_t for device finding APIs 2024-09-03 12:48:51 +02:00
firmware.c
hypervisor.c
init.c
isa.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
Kconfig arch_numa: switch over to numa_memblks 2024-09-03 21:15:32 -07:00
Makefile driver core: auxiliary bus: show auxiliary device IRQs 2024-07-11 14:17:03 -07:00
map.c
memory.c mm: add build-time option for hotplug memory default online type 2025-01-25 20:22:21 -08:00
module.c Revert "driver core: Fix uevent_show() vs driver detach race" 2024-10-29 01:23:43 +01:00
node.c driver core: Constify bin_attribute definitions 2024-11-15 19:29:16 +01:00
physical_location.c ACPI: bus: change the prototype for acpi_get_physical_device_location 2024-12-19 20:59:35 +01:00
physical_location.h
pinctrl.c
platform-msi.c genirq/msi: Remove platform MSI leftovers 2024-07-18 20:31:21 +02:00
platform.c platform: Make platform_bus_type constant 2024-09-03 13:00:50 +02:00
property.c device property: Split property reading bool and presence test ops 2025-01-13 17:47:29 -06:00
soc.c
swnode.c device property: Split property reading bool and presence test ops 2025-01-13 17:47:29 -06:00
syscore.c
topology.c topology: Keep the cpumask unchanged when printing cpumap 2025-01-07 17:58:08 +01:00
trace.c
trace.h devres: Fix page faults when tracing devres from unloaded modules 2024-10-14 08:21:09 +02:00
transport_class.c