1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/misc
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
..
altera-stapl move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
bcm-vk move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
c2port misc: c2port: Constify 'struct bin_attribute' 2024-12-24 09:36:02 +01:00
cardreader drivers/card_reader/rtsx_usb: Restore interrupt based detection 2025-01-10 15:42:53 +01:00
cb710 cb710: avoid NULL pointer subtraction 2021-10-05 15:50:05 +02:00
cxl Char/Misc/IIO driver updates for 6.14-rc1 2025-01-27 16:51:51 -08:00
echo char: Replace HTTP links with HTTPS ones 2020-07-23 09:44:15 +02:00
eeprom misc: eeprom/max6875: Constify 'struct bin_attribute' 2024-12-24 09:36:02 +01:00
genwqe mm, treewide: rename MAX_ORDER to MAX_PAGE_ORDER 2024-01-08 15:27:15 -08:00
ibmasm ibmasm: convert to new timestamp accessors 2023-10-18 13:26:16 +02:00
keba misc: keba: Fix kernfs warning on module unload 2025-01-10 10:16:39 +01:00
lis3lv02d [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
lkdtm Compiler Attributes: disable __counted_by for clang < 19.1.3 2024-11-19 08:48:27 -08:00
mchp_pci1xxxx Merge 6.13-rc4 into char-misc-next 2025-01-13 06:17:49 +01:00
mei module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
ocxl ocxl: Constify 'struct bin_attribute' 2024-12-24 09:36:01 +01:00
pvpanic Linux 6.9-rc7 2024-05-08 19:21:51 +01:00
sgi-gru misc: sgi-gru: Don't disable preemption in GRU driver 2024-10-09 12:47:01 -07:00
sgi-xp treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
uacce uacce: make uacce_class constant 2023-10-27 08:51:00 +02:00
vmw_vmci VMCI: Fix use-after-free when removing resource in vmci_resource_remove() 2024-09-03 13:16:42 +02:00
ad525x_dpot-i2c.c misc: Switch i2c drivers back to use .probe() 2023-05-29 15:04:52 +01:00
ad525x_dpot-spi.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
ad525x_dpot.c misc: ad525x_dpot: Make ad_dpot_remove() return void 2021-10-13 14:35:37 +02:00
ad525x_dpot.h misc: ad525x_dpot: Make ad_dpot_remove() return void 2021-10-13 14:35:37 +02:00
apds990x.c misc: apds990x: Fix missing pm_runtime_disable() 2024-10-13 17:10:53 +02:00
apds9802als.c misc: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-07-03 16:41:00 +02:00
atmel-ssc.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
bh1770glc.c misc: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-07-03 16:41:00 +02:00
cs5535-mfgpt.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 206 2019-05-30 11:29:53 -07:00
ds1682.c misc: ds1682: Constify 'struct bin_attribute' 2024-12-24 09:36:02 +01:00
dummy-irq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
dw-xdata-pcie.c dw-xdata: Remove usage of the deprecated ida_simple_*() API 2023-12-31 11:09:26 +00:00
enclosure.c drivers: remove struct module * setting from struct class 2023-03-17 15:16:27 +01:00
fastrpc.c misc: fastrpc: Fix copy buffer page size 2025-01-10 16:17:49 +01:00
gehc-achc.c misc: gehc-achc: Follow renaming of SPI "master" to "controller" 2024-02-08 11:54:43 +00:00
hi6421v600-irq.c misc: hi6421-spmi-pmic: Remove unused of_gpio.h 2024-03-05 14:28:41 +00:00
hisi_hikey_usb.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
hmc6352.c misc: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-07-03 16:41:00 +02:00
hpilo.c misc: hpilo: rename device creation loop variable 2024-01-30 16:19:43 -08:00
hpilo.h misc: hpilo: map iLO shared memory by PCI revision id 2021-06-04 15:28:23 +02:00
ibmvmc.c Char/Misc and other driver changes for 6.7-rc1 2023-11-03 14:51:08 -10:00
ibmvmc.h misc: Use the correct style for SPDX License Identifier 2019-10-10 15:34:40 +02:00
ics932s401.c misc: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-07-03 16:41:00 +02:00
isl29003.c misc: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-07-03 16:41:00 +02:00
isl29020.c misc: isl29020: Fix the wrong format specifier 2024-11-12 12:54:53 +01:00
Kconfig misc: Kconfig: Make MCHP_LAN966X_PCI depend on OF_OVERLAY 2025-01-10 10:16:31 +01:00
kgdbts.c kgdbts: fix hw_access_break_test 2024-08-13 11:27:38 +02:00
lan966x_pci.c misc: Add support for LAN966x PCI device 2024-10-24 12:09:33 +02:00
lan966x_pci.dtso misc: lan966x_pci: Fix dtc warn 'Missing interrupt-parent' 2024-11-04 14:34:25 +01:00
lattice-ecp3-config.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
Makefile misc:minor basic kunit tests 2025-01-08 13:18:10 +01:00
misc_minor_kunit.c misc:minor basic kunit tests 2025-01-08 13:18:10 +01:00
mrvl_cn10k_dpi.c misc: mrvl-cn10k-dpi: add Octeon CN10K DPI administrative driver 2024-07-10 14:58:29 +02:00
nsm.c misc: nsm: drop owner assignment 2024-05-22 08:31:17 -04:00
ntsync.c ntsync: Fix reference leaks in the remaining create ioctls. 2025-01-17 13:10:07 +01:00
open-dice.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
pch_phub.c misc: pch_phub: Constify 'struct bin_attribute' 2024-12-24 09:36:02 +01:00
pci_endpoint_test.c misc: pci_endpoint_test: Fix IOCTL return value 2025-01-21 14:17:55 -06:00
phantom.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
qcom-coincell.c misc: Explicitly include correct DT includes 2023-08-04 15:39:04 +02:00
rpmb-core.c rpmb: Remove some useless locking 2024-10-13 17:11:51 +02:00
smpro-errmon.c misc: smpro-errmon: Remove the unneeded include <linux/i2c.h> 2023-05-31 19:00:10 +01:00
smpro-misc.c misc: smpro-misc: Add Ampere's Altra SMpro misc driver 2022-11-10 19:03:03 +01:00
sram-exec.c mm: Introduce set_memory_rox() 2022-12-15 10:37:26 -08:00
sram.c misc: sram: constify 'struct bin_attribute' 2024-12-24 09:36:02 +01:00
sram.h misc: sram: Improve and simplify clk handling 2023-03-09 17:31:53 +01:00
tifm_7xx1.c misc: tifm: use 'time_left' variable with wait_for_completion_timeout() 2024-07-03 16:40:18 +02:00
tifm_core.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
tps6594-esm.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
tps6594-pfsm.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
tsl2550.c misc: tsl2550: replace simple_strtoul to kstrtoul 2024-09-03 12:34:31 +02:00
vcpu_stall_detector.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
vmw_balloon.c vmw_balloon: dynamically allocate the vmw-balloon shrinker 2023-10-04 10:32:25 -07:00
xilinx_sdfec.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
xilinx_tmr_inject.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
xilinx_tmr_manager.c misc: Explicitly include correct DT includes 2023-08-04 15:39:04 +02:00