1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/perf
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
..
amlogic perf: Switch back to struct platform_driver::remove() 2024-11-06 14:16:20 +00:00
arm_cspmu perf: arm_cspmu: nvidia: monitor all ports by default 2024-12-09 15:07:49 +00:00
hisilicon drivers/perf: hisi: Set correct IRQ affinity for PMUs with no association 2025-01-07 17:17:32 +00:00
alibaba_uncore_drw_pmu.c perf: Switch back to struct platform_driver::remove() 2024-11-06 14:16:20 +00:00
apple_m1_cpu_pmu.c drivers/perf: apple_m1: Map generic branch events 2025-01-10 13:32:56 +00:00
arm-cci.c perf: Switch back to struct platform_driver::remove() 2024-11-06 14:16:20 +00:00
arm-ccn.c perf: Switch back to struct platform_driver::remove() 2024-11-06 14:16:20 +00:00
arm-cmn.c perf/arm-cmn: Permit more exhaustive groups 2024-12-19 15:33:42 +00:00
arm-ni.c perf: arm-ni: Remove spurious NULL in attribute_group definition 2024-11-18 16:20:46 +01:00
arm_dmc620_pmu.c perf: Switch back to struct platform_driver::remove() 2024-11-06 14:16:20 +00:00
arm_dsu_pmu.c perf: Switch back to struct platform_driver::remove() 2024-11-06 14:16:20 +00:00
arm_pmu.c perf: arm_pmu: Remove event index to counter remapping 2024-08-16 13:09:11 +01:00
arm_pmu_acpi.c arm_pmu: acpi: Add a representative platform device for TRBE 2023-08-18 18:07:10 +01:00
arm_pmu_platform.c perf: arm_pmu: Use of_property_present() 2024-08-16 13:08:21 +01:00
arm_pmuv3.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
arm_smmuv3_pmu.c perf/arm-smmuv3: Fix lockdep assert in ->event_init() 2024-11-25 18:52:46 +00:00
arm_spe_pmu.c perf: arm_spe: Add format option for discard mode 2025-01-10 14:50:55 +00:00
arm_v6_pmu.c perf: arm_pmu: Remove event index to counter remapping 2024-08-16 13:09:11 +01:00
arm_v7_pmu.c perf: arm_pmu: Remove event index to counter remapping 2024-08-16 13:09:11 +01:00
arm_xscale_pmu.c perf: arm_pmu: Remove event index to counter remapping 2024-08-16 13:09:11 +01:00
cxl_pmu.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
dwc_pcie_pmu.c perf/dwc_pcie: Qualify RAS DES VSEC Capability by Vendor, Revision 2024-12-11 21:46:36 +00:00
fsl_imx8_ddr_perf.c perf: Switch back to struct platform_driver::remove() 2024-11-06 14:16:20 +00:00
fsl_imx9_ddr_perf.c perf: imx9_perf: Introduce AXI filter version to refactor the driver and better extension 2024-12-19 15:50:32 +00:00
Kconfig perf/marvell: Marvell PEM performance monitor support 2024-10-28 17:35:35 +00:00
Makefile perf/marvell: Marvell PEM performance monitor support 2024-10-28 17:35:35 +00:00
marvell_cn10k_ddr_pmu.c perf/marvell: Odyssey DDR Performance monitor support 2024-12-09 15:57:39 +00:00
marvell_cn10k_tad_pmu.c perf/marvell: Odyssey LLC-TAD performance monitor support 2024-12-09 15:57:49 +00:00
marvell_pem_pmu.c perf/marvell: Marvell PEM performance monitor support 2024-10-28 17:35:35 +00:00
qcom_l2_pmu.c perf: Switch back to struct platform_driver::remove() 2024-11-06 14:16:20 +00:00
qcom_l3_pmu.c Driver core changes for 6.10-rc1 2024-05-22 12:13:40 -07:00
riscv_pmu.c drivers/perf: riscv: Remove redundant macro check 2024-09-15 20:15:48 -07:00
riscv_pmu_legacy.c drivers/perf: riscv: Align errno for unsupported perf event 2024-10-01 02:47:39 -07:00
riscv_pmu_sbi.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
starfive_starlink_pmu.c perf: starfive: Add StarLink PMU support 2024-03-04 14:19:48 +00:00
thunderx2_pmu.c perf: Switch back to struct platform_driver::remove() 2024-11-06 14:16:20 +00:00
xgene_pmu.c perf: Switch back to struct platform_driver::remove() 2024-11-06 14:16:20 +00:00