]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
treewide: const qualify ctl_tables where applicable
authorJoel Granados <joel.granados@kernel.org>
Tue, 28 Jan 2025 12:48:37 +0000 (13:48 +0100)
committerJoel Granados <joel.granados@kernel.org>
Tue, 28 Jan 2025 12:48:37 +0000 (13:48 +0100)
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 78eb4ea25cd5 ("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>
106 files changed:
arch/arm/kernel/isa.c
arch/arm64/kernel/fpsimd.c
arch/arm64/kernel/process.c
arch/powerpc/kernel/idle.c
arch/powerpc/platforms/pseries/mobility.c
arch/riscv/kernel/process.c
arch/riscv/kernel/vector.c
arch/s390/appldata/appldata_base.c
arch/s390/kernel/debug.c
arch/s390/kernel/hiperdispatch.c
arch/s390/kernel/topology.c
arch/s390/mm/cmm.c
arch/s390/mm/pgalloc.c
arch/x86/entry/vdso/vdso32-setup.c
arch/x86/kernel/cpu/bus_lock.c
crypto/fips.c
drivers/base/firmware_loader/fallback_table.c
drivers/cdrom/cdrom.c
drivers/char/hpet.c
drivers/char/ipmi/ipmi_poweroff.c
drivers/char/random.c
drivers/gpu/drm/i915/i915_perf.c
drivers/gpu/drm/xe/xe_observation.c
drivers/hv/hv_common.c
drivers/md/md.c
drivers/misc/sgi-xp/xpc_main.c
drivers/perf/arm_pmuv3.c
drivers/perf/riscv_pmu_sbi.c
drivers/scsi/scsi_sysctl.c
drivers/scsi/sg.c
drivers/tty/tty_io.c
drivers/xen/balloon.c
fs/aio.c
fs/cachefiles/error_inject.c
fs/coda/sysctl.c
fs/coredump.c
fs/dcache.c
fs/devpts/inode.c
fs/eventpoll.c
fs/exec.c
fs/file_table.c
fs/fuse/sysctl.c
fs/inode.c
fs/lockd/svc.c
fs/locks.c
fs/namei.c
fs/namespace.c
fs/nfs/nfs4sysctl.c
fs/nfs/sysctl.c
fs/notify/dnotify/dnotify.c
fs/notify/fanotify/fanotify_user.c
fs/notify/inotify/inotify_user.c
fs/ocfs2/stackglue.c
fs/pipe.c
fs/quota/dquot.c
fs/sysctls.c
fs/userfaultfd.c
fs/verity/init.c
fs/xfs/xfs_sysctl.c
init/do_mounts_initrd.c
io_uring/io_uring.c
ipc/ipc_sysctl.c
ipc/mq_sysctl.c
kernel/acct.c
kernel/bpf/syscall.c
kernel/delayacct.c
kernel/exit.c
kernel/hung_task.c
kernel/kexec_core.c
kernel/kprobes.c
kernel/latencytop.c
kernel/locking/lockdep.c
kernel/panic.c
kernel/pid.c
kernel/pid_namespace.c
kernel/pid_sysctl.h
kernel/printk/sysctl.c
kernel/reboot.c
kernel/sched/autogroup.c
kernel/sched/core.c
kernel/sched/deadline.c
kernel/sched/fair.c
kernel/sched/rt.c
kernel/sched/topology.c
kernel/seccomp.c
kernel/signal.c
kernel/stackleak.c
kernel/sysctl-test.c
kernel/sysctl.c
kernel/time/timer.c
kernel/trace/ftrace.c
kernel/trace/trace_events_user.c
kernel/umh.c
kernel/utsname_sysctl.c
kernel/watchdog.c
lib/test_sysctl.c
mm/compaction.c
mm/hugetlb.c
mm/hugetlb_vmemmap.c
mm/memory-failure.c
mm/oom_kill.c
mm/page-writeback.c
mm/page_alloc.c
security/apparmor/lsm.c
security/keys/sysctl.c
security/yama/yama_lsm.c

index 905b1b1915468cfdff02af373489f6c4e358bbf3..db8be609fab24593a676e2691e83404952667d51 100644 (file)
@@ -16,7 +16,7 @@
 
 static unsigned int isa_membase, isa_portbase, isa_portshift;
 
-static struct ctl_table ctl_isa_vars[] = {
+static const struct ctl_table ctl_isa_vars[] = {
        {
                .procname       = "membase",
                .data           = &isa_membase, 
index 8c4c1a2186cc510a7826d15ec36225857c07ed71..2b601d88762d41f546b618a3c448118a18317136 100644 (file)
@@ -562,7 +562,7 @@ static int vec_proc_do_default_vl(const struct ctl_table *table, int write,
        return 0;
 }
 
-static struct ctl_table sve_default_vl_table[] = {
+static const struct ctl_table sve_default_vl_table[] = {
        {
                .procname       = "sve_default_vector_length",
                .mode           = 0644,
@@ -585,7 +585,7 @@ static int __init sve_sysctl_init(void) { return 0; }
 #endif /* ! (CONFIG_ARM64_SVE && CONFIG_SYSCTL) */
 
 #if defined(CONFIG_ARM64_SME) && defined(CONFIG_SYSCTL)
-static struct ctl_table sme_default_vl_table[] = {
+static const struct ctl_table sme_default_vl_table[] = {
        {
                .procname       = "sme_default_vector_length",
                .mode           = 0644,
index 2968a33bb3bc16208ff672590fd9a9a8d0b26b19..42faebb7b712328a8bebd25c47b01f09daae3861 100644 (file)
@@ -859,7 +859,7 @@ long get_tagged_addr_ctrl(struct task_struct *task)
  * disable it for tasks that already opted in to the relaxed ABI.
  */
 
-static struct ctl_table tagged_addr_sysctl_table[] = {
+static const struct ctl_table tagged_addr_sysctl_table[] = {
        {
                .procname       = "tagged_addr_disabled",
                .mode           = 0644,
index 30b56c67fa610e67eab62329f45d9fe48959231e..e527cd3ef128b9b77869103f26b9c183d6018fcd 100644 (file)
@@ -97,7 +97,7 @@ void power4_idle(void)
 /*
  * Register the sysctl to set/clear powersave_nap.
  */
-static struct ctl_table powersave_nap_ctl_table[] = {
+static const struct ctl_table powersave_nap_ctl_table[] = {
        {
                .procname       = "powersave-nap",
                .data           = &powersave_nap,
index 1798f0f14d58a3ec555ac9bcbf5fb4132ba167d7..62bd8e2d5d4c0b961bbd06b8bf5bbc5b7da054af 100644 (file)
@@ -53,7 +53,7 @@ struct update_props_workarea {
 static unsigned int nmi_wd_lpm_factor = 200;
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table nmi_wd_lpm_factor_ctl_table[] = {
+static const struct ctl_table nmi_wd_lpm_factor_ctl_table[] = {
        {
                .procname       = "nmi_wd_lpm_factor",
                .data           = &nmi_wd_lpm_factor,
index 58b6482c2bf662bf5224ca50c8e21a68760a6b41..7891294abf4937de3c7e440573844253e856b39f 100644 (file)
@@ -364,7 +364,7 @@ static bool try_to_set_pmm(unsigned long value)
  * disable it for tasks that already opted in to the relaxed ABI.
  */
 
-static struct ctl_table tagged_addr_sysctl_table[] = {
+static const struct ctl_table tagged_addr_sysctl_table[] = {
        {
                .procname       = "tagged_addr_disabled",
                .mode           = 0644,
index 821818886fab06aa054e2ba3266897e9b4d161c0..d022b028ac3ff5375f522947d34166266ceb424a 100644 (file)
@@ -287,7 +287,7 @@ long riscv_v_vstate_ctrl_set_current(unsigned long arg)
 
 #ifdef CONFIG_SYSCTL
 
-static struct ctl_table riscv_v_default_vstate_table[] = {
+static const struct ctl_table riscv_v_default_vstate_table[] = {
        {
                .procname       = "riscv_v_default_allow",
                .data           = &riscv_v_implicit_uacc,
index 91a30e017d658d76af6d5a0b42af4a763618379e..dd7ba7587dd5c00bd53a01cefafdacf6e5736b2c 100644 (file)
@@ -52,7 +52,7 @@ static int appldata_interval_handler(const struct ctl_table *ctl, int write,
                                     void *buffer, size_t *lenp, loff_t *ppos);
 
 static struct ctl_table_header *appldata_sysctl_header;
-static struct ctl_table appldata_table[] = {
+static const struct ctl_table appldata_table[] = {
        {
                .procname       = "timer",
                .mode           = S_IRUGO | S_IWUSR,
index ba6b7329a10e97c67218b3fd3936e30c2d16fdc5..ce038e9205f718ec9b831ce98d30373e9b4dd2ef 100644 (file)
@@ -1122,7 +1122,7 @@ static int s390dbf_procactive(const struct ctl_table *table, int write,
                return 0;
 }
 
-static struct ctl_table s390dbf_table[] = {
+static const struct ctl_table s390dbf_table[] = {
        {
                .procname       = "debug_stoppable",
                .data           = &debug_stoppable,
index 2a99a216ab629e5614a0820416a8cb54a2fe3816..7857a7e8e56cb3a85fbad042b2f9ef9ab8b7d0a4 100644 (file)
@@ -292,7 +292,7 @@ static int hiperdispatch_ctl_handler(const struct ctl_table *ctl, int write,
        return 0;
 }
 
-static struct ctl_table hiperdispatch_ctl_table[] = {
+static const struct ctl_table hiperdispatch_ctl_table[] = {
        {
                .procname       = "hiperdispatch",
                .mode           = 0644,
index 3808f942a43333e62b64596f53d07a5a12297d42..211cc8382e4a953954a40ff7c485ea76e7e5cf43 100644 (file)
@@ -667,7 +667,7 @@ static int polarization_ctl_handler(const struct ctl_table *ctl, int write,
        return set_polarization(polarization);
 }
 
-static struct ctl_table topology_ctl_table[] = {
+static const struct ctl_table topology_ctl_table[] = {
        {
                .procname       = "topology",
                .mode           = 0644,
index 7bf0f691827b5510f52a679f349773fbc44e647a..39f44b6256e0da24f305f547d15a62f5772d3fd5 100644 (file)
@@ -332,7 +332,7 @@ static int cmm_timeout_handler(const struct ctl_table *ctl, int write,
        return 0;
 }
 
-static struct ctl_table cmm_table[] = {
+static const struct ctl_table cmm_table[] = {
        {
                .procname       = "cmm_pages",
                .mode           = 0644,
index d33f55b7ee981f144e49d826028dc461244b4b5f..cd2fef79ad2c70863145879b30d63d5bfa9416f9 100644 (file)
@@ -21,7 +21,7 @@
 int page_table_allocate_pgste = 0;
 EXPORT_SYMBOL(page_table_allocate_pgste);
 
-static struct ctl_table page_table_sysctl[] = {
+static const struct ctl_table page_table_sysctl[] = {
        {
                .procname       = "allocate_pgste",
                .data           = &page_table_allocate_pgste,
index 76e4e74f35b5ab2166cd14f1b8cc91d46f8d31e5..f6d2d8aba6434a3053d9a53eb027ed74e14423e6 100644 (file)
@@ -57,7 +57,7 @@ __setup_param("vdso=", vdso_setup, vdso32_setup, 0);
 /* Register vsyscall32 into the ABI table */
 #include <linux/sysctl.h>
 
-static struct ctl_table abi_table2[] = {
+static const struct ctl_table abi_table2[] = {
        {
                .procname       = "vsyscall32",
                .data           = &vdso32_enabled,
index 704e9241b96404bb104308bf537e99907c9973b1..6cba85c79d42d6551d65156b53e7e0e92c454abe 100644 (file)
@@ -49,7 +49,7 @@ static unsigned int sysctl_sld_mitigate = 1;
 static DEFINE_SEMAPHORE(buslock_sem, 1);
 
 #ifdef CONFIG_PROC_SYSCTL
-static struct ctl_table sld_sysctls[] = {
+static const struct ctl_table sld_sysctls[] = {
        {
                .procname       = "split_lock_mitigate",
                .data           = &sysctl_sld_mitigate,
index a58e7750f53295263b14adde75408d3492985f8f..2fa3a9ee61a150db35370aec689d4790140fa24f 100644 (file)
@@ -41,7 +41,7 @@ __setup("fips=", fips_enable);
 static char fips_name[] = FIPS_MODULE_NAME;
 static char fips_version[] = FIPS_MODULE_VERSION;
 
-static struct ctl_table crypto_sysctl_table[] = {
+static const struct ctl_table crypto_sysctl_table[] = {
        {
                .procname       = "fips_enabled",
                .data           = &fips_enabled,
index ddb70e29eb423394c8c124df076eaeb6354c5cfa..c8afc501a8a476d70de70f24bd9504891cddc48f 100644 (file)
@@ -25,7 +25,7 @@ struct firmware_fallback_config fw_fallback_config = {
 EXPORT_SYMBOL_NS_GPL(fw_fallback_config, "FIRMWARE_LOADER_PRIVATE");
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table firmware_config_table[] = {
+static const struct ctl_table firmware_config_table[] = {
        {
                .procname       = "force_sysfs_fallback",
                .data           = &fw_fallback_config.force_sysfs_fallback,
index 51745ed1bbabc268b0c080b3527c89dd1b92c543..b163e043c68733907ba3a558d23dab7d72acb1e2 100644 (file)
@@ -3612,7 +3612,7 @@ static int cdrom_sysctl_handler(const struct ctl_table *ctl, int write,
 }
 
 /* Place files in /proc/sys/dev/cdrom */
-static struct ctl_table cdrom_table[] = {
+static const struct ctl_table cdrom_table[] = {
        {
                .procname       = "info",
                .data           = &cdrom_sysctl_settings.info, 
index 48fe96ab4649010263725aff5aef14a7a0403009..e110857824fcb5cdc9fd55117168f6547358d2a6 100644 (file)
@@ -724,7 +724,7 @@ static int hpet_is_known(struct hpet_data *hdp)
        return 0;
 }
 
-static struct ctl_table hpet_table[] = {
+static const struct ctl_table hpet_table[] = {
        {
         .procname = "max-user-freq",
         .data = &hpet_max_freq,
index 05f17e3e6207bb9d4f7e4f4ae7fbe8cc5a1edcf1..e63c316d8aaa505edf98fc2fff2004b8e7ac75db 100644 (file)
@@ -650,7 +650,7 @@ static struct ipmi_smi_watcher smi_watcher = {
 #ifdef CONFIG_PROC_FS
 #include <linux/sysctl.h>
 
-static struct ctl_table ipmi_table[] = {
+static const struct ctl_table ipmi_table[] = {
        { .procname     = "poweroff_powercycle",
          .data         = &poweroff_powercycle,
          .maxlen       = sizeof(poweroff_powercycle),
index 23ee76bbb4aa728274bf9980a60b863216d88797..2581186fa61b7b278916a27f99ee22b4851dc37a 100644 (file)
@@ -1665,7 +1665,7 @@ static int proc_do_rointvec(const struct ctl_table *table, int write, void *buf,
        return write ? 0 : proc_dointvec(table, 0, buf, lenp, ppos);
 }
 
-static struct ctl_table random_table[] = {
+static const struct ctl_table random_table[] = {
        {
                .procname       = "poolsize",
                .data           = &sysctl_poolsize,
index 2406cda75b7b4b26afe2517621ec0b7b290f4bd9..5384d1bb492338a66bca8e558b9126ea5536a5b1 100644 (file)
@@ -4802,7 +4802,7 @@ err_unlock:
        return ret;
 }
 
-static struct ctl_table oa_table[] = {
+static const struct ctl_table oa_table[] = {
        {
         .procname = "perf_stream_paranoid",
         .data = &i915_perf_stream_paranoid,
index 8ec1b84cbb9e465afbeb2a0c5870c7a8d0733b05..57cf01efc07f8a9b66352c71ae7329d372f40764 100644 (file)
@@ -56,7 +56,7 @@ int xe_observation_ioctl(struct drm_device *dev, void *data, struct drm_file *fi
        }
 }
 
-static struct ctl_table observation_ctl_table[] = {
+static const struct ctl_table observation_ctl_table[] = {
        {
         .procname = "observation_paranoid",
         .data = &xe_observation_paranoid,
index af5d1dc451f67a5d8b9bbd5595399e5a37385308..f2e6f55d6ca629d339e3280c40b3e4913ae8429d 100644 (file)
@@ -141,7 +141,7 @@ static int sysctl_record_panic_msg = 1;
  * sysctl option to allow the user to control whether kmsg data should be
  * reported to Hyper-V on panic.
  */
-static struct ctl_table hv_ctl_table[] = {
+static const struct ctl_table hv_ctl_table[] = {
        {
                .procname       = "hyperv_record_panic_msg",
                .data           = &sysctl_record_panic_msg,
index 866015b681af8e95a160f1a3bf6058b28bc99906..22f7bd3b94d582f14fbda31c3ba8b3552f38e9f5 100644 (file)
@@ -294,7 +294,7 @@ void mddev_destroy_serial_pool(struct mddev *mddev, struct md_rdev *rdev)
 
 static struct ctl_table_header *raid_table_header;
 
-static struct ctl_table raid_table[] = {
+static const struct ctl_table raid_table[] = {
        {
                .procname       = "speed_limit_min",
                .data           = &sysctl_speed_limit_min,
index 61b66e318488cd5b5ab6378fe800351a4e458aa0..7a3c34306de9811db41b5d38ca2c3f0ed2d8354c 100644 (file)
@@ -93,7 +93,7 @@ int xpc_disengage_timelimit = XPC_DISENGAGE_DEFAULT_TIMELIMIT;
 static int xpc_disengage_min_timelimit;        /* = 0 */
 static int xpc_disengage_max_timelimit = 120;
 
-static struct ctl_table xpc_sys_xpc_hb[] = {
+static const struct ctl_table xpc_sys_xpc_hb[] = {
        {
         .procname = "hb_interval",
         .data = &xpc_hb_interval,
@@ -111,7 +111,7 @@ static struct ctl_table xpc_sys_xpc_hb[] = {
         .extra1 = &xpc_hb_check_min_interval,
         .extra2 = &xpc_hb_check_max_interval},
 };
-static struct ctl_table xpc_sys_xpc[] = {
+static const struct ctl_table xpc_sys_xpc[] = {
        {
         .procname = "disengage_timelimit",
         .data = &xpc_disengage_timelimit,
index b5cc11abc962cc80e87afa26688a59f381eea105..0e360feb3432e14815dd88d8ec92f25161b2220a 100644 (file)
@@ -1279,7 +1279,7 @@ static int armv8pmu_proc_user_access_handler(const struct ctl_table *table, int
        return 0;
 }
 
-static struct ctl_table armv8_pmu_sysctl_table[] = {
+static const struct ctl_table armv8_pmu_sysctl_table[] = {
        {
                .procname       = "perf_user_access",
                .data           = &sysctl_perf_user_access,
index 194c153e5d71c62a48fe133db360ae21c96d5166..698de8ddf895ba8528c1b0acb5220d157f5f89a1 100644 (file)
@@ -1317,7 +1317,7 @@ static int riscv_pmu_proc_user_access_handler(const struct ctl_table *table,
        return 0;
 }
 
-static struct ctl_table sbi_pmu_sysctl_table[] = {
+static const struct ctl_table sbi_pmu_sysctl_table[] = {
        {
                .procname       = "perf_user_access",
                .data           = &sysctl_perf_user_access,
index 093774d77534659596060d5a4e94c33edb271c9e..be4aef0f4f9962c32c4bfed020e62d0ad1e86b65 100644 (file)
@@ -12,7 +12,7 @@
 #include "scsi_priv.h"
 
 
-static struct ctl_table scsi_table[] = {
+static const struct ctl_table scsi_table[] = {
        { .procname     = "logging_level",
          .data         = &scsi_logging_level,
          .maxlen       = sizeof(scsi_logging_level),
index 94127868bedf8a2accdbac06a54fff7ea747148d..effb7e76816596e1ba4f81f84ae7141f429ae231 100644 (file)
@@ -1639,7 +1639,7 @@ MODULE_PARM_DESC(allow_dio, "allow direct I/O (default: 0 (disallow))");
 #ifdef CONFIG_SYSCTL
 #include <linux/sysctl.h>
 
-static struct ctl_table sg_sysctls[] = {
+static const struct ctl_table sg_sysctls[] = {
        {
                .procname       = "sg-big-buff",
                .data           = &sg_big_buff,
index 50c0c23ae67808f3bc804a3f62bce2279f7a1940..449dbd21646036dc09bc881bb4d68ac724603143 100644 (file)
@@ -3617,7 +3617,7 @@ void console_sysfs_notify(void)
                sysfs_notify(&consdev->kobj, NULL, "active");
 }
 
-static struct ctl_table tty_table[] = {
+static const struct ctl_table tty_table[] = {
        {
                .procname       = "legacy_tiocsti",
                .data           = &tty_legacy_tiocsti,
index 528395133b4f8e37517015399413f8c900153d6a..163f7f1d70f1b17ad93575e4902004cfe9da5d4e 100644 (file)
@@ -84,7 +84,7 @@ module_param(balloon_boot_timeout, uint, 0444);
 #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
 static int xen_hotplug_unpopulated;
 
-static struct ctl_table balloon_table[] = {
+static const struct ctl_table balloon_table[] = {
        {
                .procname       = "hotplug_unpopulated",
                .data           = &xen_hotplug_unpopulated,
index 50671640b5883f5d20f652e23c4ea3fe04c989f2..7b976b564cfc4b34eb70a3a5cb60782fbee92288 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -224,7 +224,7 @@ static unsigned long aio_nr;                /* current system wide number of aio requests */
 static unsigned long aio_max_nr = 0x10000; /* system wide maximum number of aio requests */
 /*----end sysctl variables---*/
 #ifdef CONFIG_SYSCTL
-static struct ctl_table aio_sysctls[] = {
+static const struct ctl_table aio_sysctls[] = {
        {
                .procname       = "aio-nr",
                .data           = &aio_nr,
index 1715d5ca2b2d2470750bf5ecd50f113187693c5b..e341ade47dd8a4610a465256a9af17aaf3432c03 100644 (file)
@@ -11,7 +11,7 @@
 unsigned int cachefiles_error_injection_state;
 
 static struct ctl_table_header *cachefiles_sysctl;
-static struct ctl_table cachefiles_sysctls[] = {
+static const struct ctl_table cachefiles_sysctls[] = {
        {
                .procname       = "error_injection",
                .data           = &cachefiles_error_injection_state,
index 9f2d5743e2c890ec37ee83e8680ceea3487ff80d..0df46f09b6cc580ab4d924ca2df92a9ac5edad6e 100644 (file)
@@ -14,7 +14,7 @@
 
 static struct ctl_table_header *fs_table_header;
 
-static struct ctl_table coda_table[] = {
+static const struct ctl_table coda_table[] = {
        {
                .procname       = "timeout",
                .data           = &coda_timeout,
index d48edb37bc35c0896d97a2f6a6cc259d8812f936..591700e1b2ce689e09272f75849673495d38126b 100644 (file)
@@ -995,7 +995,7 @@ static int proc_dostring_coredump(const struct ctl_table *table, int write,
 static const unsigned int core_file_note_size_min = CORE_FILE_NOTE_SIZE_DEFAULT;
 static const unsigned int core_file_note_size_max = CORE_FILE_NOTE_SIZE_MAX;
 
-static struct ctl_table coredump_sysctls[] = {
+static const struct ctl_table coredump_sysctls[] = {
        {
                .procname       = "core_uses_pid",
                .data           = &core_uses_pid,
index 1a01d7a6a7a92ed821a65a0a1adf3b9dc7432908..1cd929f17eecf759c9eed1f814aa627df404f2b3 100644 (file)
@@ -192,7 +192,7 @@ static int proc_nr_dentry(const struct ctl_table *table, int write, void *buffer
        return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
 }
 
-static struct ctl_table fs_dcache_sysctls[] = {
+static const struct ctl_table fs_dcache_sysctls[] = {
        {
                .procname       = "dentry-state",
                .data           = &dentry_stat,
index b20e565b9c5ea3cd83c8a8d2be1629551f558286..1096ff8562fa1e65bf6b8b53ae0ba444af84e78c 100644 (file)
@@ -45,7 +45,7 @@ static int pty_limit_min;
 static int pty_limit_max = INT_MAX;
 static atomic_t pty_count = ATOMIC_INIT(0);
 
-static struct ctl_table pty_table[] = {
+static const struct ctl_table pty_table[] = {
        {
                .procname       = "max",
                .maxlen         = sizeof(int),
index f9898e60dd8bd439c5dadf4ad4fd13c1cb7f983e..7c0980db77b3178ae23699f0907bcbdaee44c458 100644 (file)
@@ -318,7 +318,7 @@ static void unlist_file(struct epitems_head *head)
 static long long_zero;
 static long long_max = LONG_MAX;
 
-static struct ctl_table epoll_table[] = {
+static const struct ctl_table epoll_table[] = {
        {
                .procname       = "max_user_watches",
                .data           = &max_user_watches,
index a4983917447244e90285c9b6bb5c6804b1e4b814..506cd411f4ac2ecd8a4ba5711fb5952d44182064 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -2159,7 +2159,7 @@ static int proc_dointvec_minmax_coredump(const struct ctl_table *table, int writ
        return error;
 }
 
-static struct ctl_table fs_exec_sysctls[] = {
+static const struct ctl_table fs_exec_sysctls[] = {
        {
                .procname       = "suid_dumpable",
                .data           = &suid_dumpable,
index a32171d2b83f589459e0306260868aaeda39d78b..7f7c378c6e31a40a7530be91903ac2085dcf737d 100644 (file)
@@ -106,7 +106,7 @@ static int proc_nr_files(const struct ctl_table *table, int write, void *buffer,
        return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
 }
 
-static struct ctl_table fs_stat_sysctls[] = {
+static const struct ctl_table fs_stat_sysctls[] = {
        {
                .procname       = "file-nr",
                .data           = &files_stat,
index b272bb333005a8ca4e5f10b2e1a659f3f38b660a..63fb1e5bee3010c7b36f4052bd2ff27ff2a78e4d 100644 (file)
@@ -13,7 +13,7 @@ static struct ctl_table_header *fuse_table_header;
 /* Bound by fuse_init_out max_pages, which is a u16 */
 static unsigned int sysctl_fuse_max_pages_limit = 65535;
 
-static struct ctl_table fuse_sysctl_table[] = {
+static const struct ctl_table fuse_sysctl_table[] = {
        {
                .procname       = "max_pages_limit",
                .data           = &fuse_max_pages_limit,
index 6b4c77268fc0ecace4ac78a9ca777fbffc277f4a..5587aabdaa5eec1212f19c2cf99420781517e64f 100644 (file)
@@ -184,7 +184,7 @@ static int proc_nr_inodes(const struct ctl_table *table, int write, void *buffer
        return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
 }
 
-static struct ctl_table inodes_sysctls[] = {
+static const struct ctl_table inodes_sysctls[] = {
        {
                .procname       = "inode-nr",
                .data           = &inodes_stat,
index 7ded57ec3a603197f22c711b40eae39104a63de4..2c8eedc6c2cc9ebcfe521d90364de84e00eae40f 100644 (file)
@@ -412,7 +412,7 @@ EXPORT_SYMBOL_GPL(lockd_down);
  * Sysctl parameters (same as module parameters, different interface).
  */
 
-static struct ctl_table nlm_sysctls[] = {
+static const struct ctl_table nlm_sysctls[] = {
        {
                .procname       = "nlm_grace_period",
                .data           = &nlm_grace_period,
index 25afc8d9c9d1211db8ff64f98261a0249ebda19b..1619cddfa7a4d799f0f84f0bc8f28458d8d280db 100644 (file)
@@ -97,7 +97,7 @@ static int leases_enable = 1;
 static int lease_break_time = 45;
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table locks_sysctls[] = {
+static const struct ctl_table locks_sysctls[] = {
        {
                .procname       = "leases-enable",
                .data           = &leases_enable,
index e56c29a22d262291741d9f06566a52225b2e3b3e..8c82afddd2ad80444e974caa5bfe80c34e258b64 100644 (file)
@@ -1099,7 +1099,7 @@ static int sysctl_protected_fifos __read_mostly;
 static int sysctl_protected_regular __read_mostly;
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table namei_sysctls[] = {
+static const struct ctl_table namei_sysctls[] = {
        {
                .procname       = "protected_symlinks",
                .data           = &sysctl_protected_symlinks,
index 4013fbac354a284732eb10e5a869b86184a52d1d..a3ed3f2980cbae6238cda09874e2dac146080eb6 100644 (file)
@@ -5985,7 +5985,7 @@ const struct proc_ns_operations mntns_operations = {
 };
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table fs_namespace_sysctls[] = {
+static const struct ctl_table fs_namespace_sysctls[] = {
        {
                .procname       = "mount-max",
                .data           = &sysctl_mount_max,
index 886a7c4c60b35a49a64a3ec67aa7fccec4a49bc0..d1a92d8f8ba4c2058ea5f094a1b11d5b30e132e0 100644 (file)
@@ -17,7 +17,7 @@ static const int nfs_set_port_min;
 static const int nfs_set_port_max = 65535;
 static struct ctl_table_header *nfs4_callback_sysctl_table;
 
-static struct ctl_table nfs4_cb_sysctls[] = {
+static const struct ctl_table nfs4_cb_sysctls[] = {
        {
                .procname = "nfs_callback_tcpport",
                .data = &nfs_callback_set_tcpport,
index e645be1a338177c0626954bf64ea659b5750b691..f579df0e8d6730bb195799314b470fb9bc564670 100644 (file)
@@ -14,7 +14,7 @@
 
 static struct ctl_table_header *nfs_callback_sysctl_table;
 
-static struct ctl_table nfs_cb_sysctls[] = {
+static const struct ctl_table nfs_cb_sysctls[] = {
        {
                .procname       = "nfs_mountpoint_timeout",
                .data           = &nfs_mountpoint_expiry_timeout,
index 6004dfdfdf0f3c6222aad9cf2697dc1cbe0a50cc..c4cdaf5fa7eda6054468a458b69905ad8d322544 100644 (file)
@@ -20,7 +20,7 @@
 
 static int dir_notify_enable __read_mostly = 1;
 #ifdef CONFIG_SYSCTL
-static struct ctl_table dnotify_sysctls[] = {
+static const struct ctl_table dnotify_sysctls[] = {
        {
                .procname       = "dir-notify-enable",
                .data           = &dir_notify_enable,
index 6ff94e3122326d561057250a6f353d6520585f78..ba3e2d09eb44ee5a7dc8229bbeac8adf805ad799 100644 (file)
@@ -58,7 +58,7 @@ static int fanotify_max_queued_events __read_mostly;
 static long ft_zero = 0;
 static long ft_int_max = INT_MAX;
 
-static struct ctl_table fanotify_table[] = {
+static const struct ctl_table fanotify_table[] = {
        {
                .procname       = "max_user_groups",
                .data   = &init_user_ns.ucount_max[UCOUNT_FANOTIFY_GROUPS],
index e0c48956608a5428dd464b907db75db74323430b..b372fb2c56bd1be48b85d97dc1e57720a0fd389d 100644 (file)
@@ -58,7 +58,7 @@ struct kmem_cache *inotify_inode_mark_cachep __ro_after_init;
 static long it_zero = 0;
 static long it_int_max = INT_MAX;
 
-static struct ctl_table inotify_table[] = {
+static const struct ctl_table inotify_table[] = {
        {
                .procname       = "max_user_instances",
                .data           = &init_user_ns.ucount_max[UCOUNT_INOTIFY_INSTANCES],
index 20aa37b67cfb1581c6a73e24d5c3577b83499643..ddd761cf44c87837270d82d303e220733322ee27 100644 (file)
@@ -650,7 +650,7 @@ error:
  * and easier to preserve the name.
  */
 
-static struct ctl_table ocfs2_nm_table[] = {
+static const struct ctl_table ocfs2_nm_table[] = {
        {
                .procname       = "hb_ctl_path",
                .data           = ocfs2_hb_ctl_path,
index 82fede0f2111e8f597de73b28d9fe4bb3ffd110a..94b59045ab44bced0e8a1e0179df0e90fe9df658 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -1478,7 +1478,7 @@ static int proc_dopipe_max_size(const struct ctl_table *table, int write,
                                 do_proc_dopipe_max_size_conv, NULL);
 }
 
-static struct ctl_table fs_pipe_sysctls[] = {
+static const struct ctl_table fs_pipe_sysctls[] = {
        {
                .procname       = "pipe-max-size",
                .data           = &pipe_max_size,
index f9578918cfb25dea6fb4cc2efd4043b0308089fb..825c5c2e09621caa8151d6f32a527516a3dd204e 100644 (file)
@@ -2926,7 +2926,7 @@ static int do_proc_dqstats(const struct ctl_table *table, int write,
        return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
 }
 
-static struct ctl_table fs_dqstats_table[] = {
+static const struct ctl_table fs_dqstats_table[] = {
        {
                .procname       = "lookups",
                .data           = &dqstats.stat[DQST_LOOKUPS],
index 8dbde9a802fa42b55542e7c7038c66ae18382472..ad429dffeb4b711198d375ac9da26d98cbbaaaa7 100644 (file)
@@ -7,7 +7,7 @@
 #include <linux/init.h>
 #include <linux/sysctl.h>
 
-static struct ctl_table fs_shared_sysctls[] = {
+static const struct ctl_table fs_shared_sysctls[] = {
        {
                .procname       = "overflowuid",
                .data           = &fs_overflowuid,
index 7c0bd0b55f8800c1af264e24c432b3d1259eab6b..97c4d71115d8a0ee505eeb534e5963d6e62d37ad 100644 (file)
@@ -36,7 +36,7 @@
 static int sysctl_unprivileged_userfaultfd __read_mostly;
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table vm_userfaultfd_table[] = {
+static const struct ctl_table vm_userfaultfd_table[] = {
        {
                .procname       = "unprivileged_userfaultfd",
                .data           = &sysctl_unprivileged_userfaultfd,
index f440f0e61e3e6ccdfd827b8fb593625e65031f3f..6e8d33b50240e088dc5c52b2e14e8c57705bcc92 100644 (file)
@@ -10,7 +10,7 @@
 #include <linux/ratelimit.h>
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table fsverity_sysctl_table[] = {
+static const struct ctl_table fsverity_sysctl_table[] = {
 #ifdef CONFIG_FS_VERITY_BUILTIN_SIGNATURES
        {
                .procname       = "require_signatures",
index c84df23b494d358af8fe41b6fad51e02c8372927..751dc74a30671a7d88974da175f22130c608d7dd 100644 (file)
@@ -66,7 +66,7 @@ xfs_deprecated_dointvec_minmax(
        return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos);
 }
 
-static struct ctl_table xfs_table[] = {
+static const struct ctl_table xfs_table[] = {
        {
                .procname       = "irix_sgid_inherit",
                .data           = &xfs_params.sgid_inherit.val,
index f86ef92a6c46177d0980a6bd0ac6dd945f7b027c..f6867bad0d782cbf0eb44c7341f1a192e3f23e43 100644 (file)
@@ -21,7 +21,7 @@ phys_addr_t phys_initrd_start __initdata;
 unsigned long phys_initrd_size __initdata;
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table kern_do_mounts_initrd_table[] = {
+static const struct ctl_table kern_do_mounts_initrd_table[] = {
        {
                .procname       = "real-root-dev",
                .data           = &real_root_dev,
index 7bfbc7c223677148deb5d40326486980f5ad1770..5a0f8a5041d6680ede8b01f21e2e0559629197eb 100644 (file)
@@ -157,7 +157,7 @@ static int __read_mostly sysctl_io_uring_disabled;
 static int __read_mostly sysctl_io_uring_group = -1;
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table kernel_io_uring_disabled_table[] = {
+static const struct ctl_table kernel_io_uring_disabled_table[] = {
        {
                .procname       = "io_uring_disabled",
                .data           = &sysctl_io_uring_disabled,
index 54318e0b455788aa7b11c512c82637b3ec4944a9..15b17e86e198cfa78c0e9999cfbf08257729963a 100644 (file)
@@ -73,7 +73,7 @@ int ipc_mni = IPCMNI;
 int ipc_mni_shift = IPCMNI_SHIFT;
 int ipc_min_cycle = RADIX_TREE_MAP_SIZE;
 
-static struct ctl_table ipc_sysctls[] = {
+static const struct ctl_table ipc_sysctls[] = {
        {
                .procname       = "shmmax",
                .data           = &init_ipc_ns.shm_ctlmax,
index b70dc2ff22d84d01dab8170df1e586dbcc6a177b..0dd12e1c9f53ef07092ca3b638335a438d273a8c 100644 (file)
@@ -20,7 +20,7 @@ static int msg_max_limit_max = HARD_MSGMAX;
 static int msg_maxsize_limit_min = MIN_MSGSIZEMAX;
 static int msg_maxsize_limit_max = HARD_MSGSIZEMAX;
 
-static struct ctl_table mq_sysctls[] = {
+static const struct ctl_table mq_sysctls[] = {
        {
                .procname       = "queues_max",
                .data           = &init_ipc_ns.mq_queues_max,
index 179848ad33e978a557ce695a0d6020aa169177c6..31222e8cd534f43c6fcc23b6e49872bbd9a025b2 100644 (file)
@@ -76,7 +76,7 @@ static int acct_parm[3] = {4, 2, 30};
 #define ACCT_TIMEOUT   (acct_parm[2])  /* foo second timeout between checks */
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table kern_acct_table[] = {
+static const struct ctl_table kern_acct_table[] = {
        {
                .procname       = "acct",
                .data           = &acct_parm,
index 0daf098e32074ba708545df61e5b414ad7fbaa02..c420edbfb7c874ddc5f0ba97d120b16c4ee81c02 100644 (file)
@@ -6128,7 +6128,7 @@ static int bpf_unpriv_handler(const struct ctl_table *table, int write,
        return ret;
 }
 
-static struct ctl_table bpf_syscall_table[] = {
+static const struct ctl_table bpf_syscall_table[] = {
        {
                .procname       = "unprivileged_bpf_disabled",
                .data           = &sysctl_unprivileged_bpf_disabled,
index b238eb8c6573a6be334e8fd69dd4a151659b0c9d..eb63a021ac0414910a09c532ccbcc2e604651394 100644 (file)
@@ -64,7 +64,7 @@ static int sysctl_delayacct(const struct ctl_table *table, int write, void *buff
        return err;
 }
 
-static struct ctl_table kern_delayacct_table[] = {
+static const struct ctl_table kern_delayacct_table[] = {
        {
                .procname       = "task_delayacct",
                .data           = NULL,
index 1dcddfe537ee3ec949bbf60966d9850c375822e5..3485e5fc499e468760302d6776fc8f915362b8bd 100644 (file)
@@ -85,7 +85,7 @@
 static unsigned int oops_limit = 10000;
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table kern_exit_table[] = {
+static const struct ctl_table kern_exit_table[] = {
        {
                .procname       = "oops_limit",
                .data           = &oops_limit,
index 953169893a95e0e17335dbaa545a48483b31d525..04efa7a6e69bfa79f0333e8d36926b00c9fab4af 100644 (file)
@@ -274,7 +274,7 @@ static int proc_dohung_task_timeout_secs(const struct ctl_table *table, int writ
  * and hung_task_check_interval_secs
  */
 static const unsigned long hung_task_timeout_max = (LONG_MAX / HZ);
-static struct ctl_table hung_task_sysctls[] = {
+static const struct ctl_table hung_task_sysctls[] = {
 #ifdef CONFIG_SMP
        {
                .procname       = "hung_task_all_cpu_backtrace",
index b424a5c6ae87e8cdcc9d30ecf6063995cd992b27..c0bdc1686154d4bd12d0c58ee1067c40cd86d473 100644 (file)
@@ -925,7 +925,7 @@ static int kexec_limit_handler(const struct ctl_table *table, int write,
        return proc_dointvec(&tmp, write, buffer, lenp, ppos);
 }
 
-static struct ctl_table kexec_core_sysctls[] = {
+static const struct ctl_table kexec_core_sysctls[] = {
        {
                .procname       = "kexec_load_disabled",
                .data           = &kexec_load_disabled,
index 0305692106709bcd60d84921f7ee9217c14b6bc1..88aeac84e4c057261da25124b81abf177ed51d23 100644 (file)
@@ -946,7 +946,7 @@ static int proc_kprobes_optimization_handler(const struct ctl_table *table,
        return ret;
 }
 
-static struct ctl_table kprobe_sysctls[] = {
+static const struct ctl_table kprobe_sysctls[] = {
        {
                .procname       = "kprobes-optimization",
                .data           = &sysctl_kprobes_optimization,
index 77ee3ea8a573cd193d7fbd09978d7034d36b0147..d4281d1e13a63650afb3aeae4d40274ba6c4f266 100644 (file)
@@ -77,7 +77,7 @@ static int sysctl_latencytop(const struct ctl_table *table, int write, void *buf
        return err;
 }
 
-static struct ctl_table latencytop_sysctl[] = {
+static const struct ctl_table latencytop_sysctl[] = {
        {
                .procname   = "latencytop",
                .data       = &latencytop_enabled,
index 29acd238dad703e75b0657908b70a54cf8fb1c7f..4470680f022697f85da14cb2d78462ac02bafd9b 100644 (file)
@@ -79,7 +79,7 @@ module_param(lock_stat, int, 0644);
 #endif
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table kern_lockdep_table[] = {
+static const struct ctl_table kern_lockdep_table[] = {
 #ifdef CONFIG_PROVE_LOCKING
        {
                .procname       = "prove_locking",
index fbc59b3b64d0b5434f8b75fa39fd73dc784479f1..d8635d5cecb2505da1c08a4f70814e9b87ac3b37 100644 (file)
@@ -84,7 +84,7 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
 EXPORT_SYMBOL(panic_notifier_list);
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table kern_panic_table[] = {
+static const struct ctl_table kern_panic_table[] = {
 #ifdef CONFIG_SMP
        {
                .procname       = "oops_all_cpu_backtrace",
index 3a10a7b6fcf805020a43d26ed8b640e3fab9d4a5..924084713be8ba9883b379baa346703fc1c91aff 100644 (file)
@@ -695,7 +695,7 @@ static struct ctl_table_root pid_table_root = {
        .set_ownership  = pid_table_root_set_ownership,
 };
 
-static struct ctl_table pid_table[] = {
+static const struct ctl_table pid_table[] = {
        {
                .procname       = "pid_max",
                .data           = &init_pid_ns.pid_max,
index f1ffa032fc32042a931c86094a21a68b882d0bb6..8f6cfec87555a3af47566b19d853306371106690 100644 (file)
@@ -303,7 +303,7 @@ static int pid_ns_ctl_handler(const struct ctl_table *table, int write,
        return ret;
 }
 
-static struct ctl_table pid_ns_ctl_table[] = {
+static const struct ctl_table pid_ns_ctl_table[] = {
        {
                .procname = "ns_last_pid",
                .maxlen = sizeof(int),
index 18ecaef6be4169a2148e49f2e2767746dd9e13d9..5d8f981de7c5628fc80efeb387f8d422a1c8e382 100644 (file)
@@ -31,7 +31,7 @@ static int pid_mfd_noexec_dointvec_minmax(const struct ctl_table *table,
        return err;
 }
 
-static struct ctl_table pid_ns_ctl_table_vm[] = {
+static const struct ctl_table pid_ns_ctl_table_vm[] = {
        {
                .procname       = "memfd_noexec",
                .data           = &init_pid_ns.memfd_noexec_scope,
index f5072dc85f7aab3f603bfee642f9d25903c3ce78..da77f3f5c1fe917d9ce2d777355403f123587757 100644 (file)
@@ -20,7 +20,7 @@ static int proc_dointvec_minmax_sysadmin(const struct ctl_table *table, int writ
        return proc_dointvec_minmax(table, write, buffer, lenp, ppos);
 }
 
-static struct ctl_table printk_sysctls[] = {
+static const struct ctl_table printk_sysctls[] = {
        {
                .procname       = "printk",
                .data           = &console_loglevel,
index a701000bab3470df28665e8c9591cd82a033c6c2..b5a8569e5d81f57a6baeddd8d166a616d2992085 100644 (file)
@@ -1287,7 +1287,7 @@ static struct attribute *reboot_attrs[] = {
 };
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table kern_reboot_table[] = {
+static const struct ctl_table kern_reboot_table[] = {
        {
                .procname       = "poweroff_cmd",
                .data           = &poweroff_cmd,
index db68a964e34e26f6f6e9943d24fefafcfe79398e..83d46b9b8ec8c0f2fc329889d8ee68ab3ea1b71a 100644 (file)
@@ -9,7 +9,7 @@ static struct autogroup autogroup_default;
 static atomic_t autogroup_seq_nr;
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table sched_autogroup_sysctls[] = {
+static const struct ctl_table sched_autogroup_sysctls[] = {
        {
                .procname       = "sched_autogroup_enabled",
                .data           = &sysctl_sched_autogroup_enabled,
index 9142a0394d46605e96e10cef97cce02d741f6c93..165c90ba64ea93b65e4db83f7b0d411553e4fdc0 100644 (file)
@@ -4654,7 +4654,7 @@ static int sysctl_schedstats(const struct ctl_table *table, int write, void *buf
 #endif /* CONFIG_SCHEDSTATS */
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table sched_core_sysctls[] = {
+static const struct ctl_table sched_core_sysctls[] = {
 #ifdef CONFIG_SCHEDSTATS
        {
                .procname       = "sched_schedstats",
index 62192ac79c30a7e75330766cb8b94dcb96b7f6de..38e4537790af7ef3006f28f7a1ae0f68afd151cf 100644 (file)
@@ -26,7 +26,7 @@
 static unsigned int sysctl_sched_dl_period_max = 1 << 22; /* ~4 seconds */
 static unsigned int sysctl_sched_dl_period_min = 100;     /* 100 us */
 #ifdef CONFIG_SYSCTL
-static struct ctl_table sched_dl_sysctls[] = {
+static const struct ctl_table sched_dl_sysctls[] = {
        {
                .procname       = "sched_deadline_period_max_us",
                .data           = &sysctl_sched_dl_period_max,
index 1e78caa21436b9e5d49d52ed0513506e35e6dd55..ce2e94ccad0c6bda6c86ab193c34630eb4db826d 100644 (file)
@@ -133,7 +133,7 @@ static unsigned int sysctl_numa_balancing_promote_rate_limit = 65536;
 #endif
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table sched_fair_sysctls[] = {
+static const struct ctl_table sched_fair_sysctls[] = {
 #ifdef CONFIG_CFS_BANDWIDTH
        {
                .procname       = "sched_cfs_bandwidth_slice_us",
index bd66a46b06acaca58df6b169ec3cbabe6be4846b..4b8e33c615b12c4cc2661ca2337b03333eec7076 100644 (file)
@@ -26,7 +26,7 @@ static int sched_rt_handler(const struct ctl_table *table, int write, void *buff
                size_t *lenp, loff_t *ppos);
 static int sched_rr_handler(const struct ctl_table *table, int write, void *buffer,
                size_t *lenp, loff_t *ppos);
-static struct ctl_table sched_rt_sysctls[] = {
+static const struct ctl_table sched_rt_sysctls[] = {
        {
                .procname       = "sched_rt_period_us",
                .data           = &sysctl_sched_rt_period,
index da33ec9e94ab2de9d9855d1a77adfc26a049ac0f..c49aea8c10254dec985bba47b18f61be954d23f6 100644 (file)
@@ -312,7 +312,7 @@ static int sched_energy_aware_handler(const struct ctl_table *table, int write,
        return ret;
 }
 
-static struct ctl_table sched_energy_aware_sysctls[] = {
+static const struct ctl_table sched_energy_aware_sysctls[] = {
        {
                .procname       = "sched_energy_aware",
                .data           = &sysctl_sched_energy_aware,
index 385d48293a5fa152bfb3e7e30a074cab3fd019db..f59381c4a2ffbb249319359889f97684e7c96fec 100644 (file)
@@ -2450,7 +2450,7 @@ static int seccomp_actions_logged_handler(const struct ctl_table *ro_table, int
        return ret;
 }
 
-static struct ctl_table seccomp_sysctl_table[] = {
+static const struct ctl_table seccomp_sysctl_table[] = {
        {
                .procname       = "actions_avail",
                .data           = (void *) &seccomp_actions_avail,
index a2afd54303f08f4fec0a7db0be775fdad31c8d00..875e97f6205a2c9daecf5bece5d53ed09667f747 100644 (file)
@@ -4950,7 +4950,7 @@ static inline void siginfo_buildtime_checks(void)
 }
 
 #if defined(CONFIG_SYSCTL)
-static struct ctl_table signal_debug_table[] = {
+static const struct ctl_table signal_debug_table[] = {
 #ifdef CONFIG_SYSCTL_EXCEPTION_TRACE
        {
                .procname       = "exception-trace",
index 0f4804f28c616e3f538f38d381d2045cd83a466b..bb65321761b43c0a27f8fe3ca1ae6b42dd648ca5 100644 (file)
@@ -45,7 +45,7 @@ static int stack_erasing_sysctl(const struct ctl_table *table, int write,
                                        str_enabled_disabled(state));
        return ret;
 }
-static struct ctl_table stackleak_sysctls[] = {
+static const struct ctl_table stackleak_sysctls[] = {
        {
                .procname       = "stack_erasing",
                .data           = NULL,
index 3ac98bb7fb822c959f0830506581015e861bd5b7..eb2842bd055771ee8a72040f96260bdb0e754ad5 100644 (file)
@@ -374,7 +374,7 @@ static void sysctl_test_register_sysctl_sz_invalid_extra_value(
                struct kunit *test)
 {
        unsigned char data = 0;
-       struct ctl_table table_foo[] = {
+       const struct ctl_table table_foo[] = {
                {
                        .procname       = "foo",
                        .data           = &data,
@@ -386,7 +386,7 @@ static void sysctl_test_register_sysctl_sz_invalid_extra_value(
                },
        };
 
-       struct ctl_table table_bar[] = {
+       const struct ctl_table table_bar[] = {
                {
                        .procname       = "bar",
                        .data           = &data,
@@ -398,7 +398,7 @@ static void sysctl_test_register_sysctl_sz_invalid_extra_value(
                },
        };
 
-       struct ctl_table table_qux[] = {
+       const struct ctl_table table_qux[] = {
                {
                        .procname       = "qux",
                        .data           = &data,
index 7ae7a413685512c790654c40dcec2e04e247f7ca..cb57da499ebb1216cefb3705694ab62028fee03e 100644 (file)
@@ -1609,7 +1609,7 @@ int proc_do_static_key(const struct ctl_table *table, int write,
        return ret;
 }
 
-static struct ctl_table kern_table[] = {
+static const struct ctl_table kern_table[] = {
        {
                .procname       = "panic",
                .data           = &panic_timeout,
@@ -2021,7 +2021,7 @@ static struct ctl_table kern_table[] = {
 #endif
 };
 
-static struct ctl_table vm_table[] = {
+static const struct ctl_table vm_table[] = {
        {
                .procname       = "overcommit_memory",
                .data           = &sysctl_overcommit_memory,
index 40706cb3692053a0fcfbe8187a223ac4386dd0e6..c8f776dc6ee08bbd8406dba4b5bc498081940b3f 100644 (file)
@@ -301,7 +301,7 @@ static int timer_migration_handler(const struct ctl_table *table, int write,
        return ret;
 }
 
-static struct ctl_table timer_sysctl[] = {
+static const struct ctl_table timer_sysctl[] = {
        {
                .procname       = "timer_migration",
                .data           = &sysctl_timer_migration,
index f79eb9386c7fac2103c93a173ad57514d0071aee..728ecda6e8d4dd48c7e784dd95b1f8b6fbd6d166 100644 (file)
@@ -8780,7 +8780,7 @@ ftrace_enable_sysctl(const struct ctl_table *table, int write,
        return 0;
 }
 
-static struct ctl_table ftrace_sysctls[] = {
+static const struct ctl_table ftrace_sysctls[] = {
        {
                .procname       = "ftrace_enabled",
                .data           = &ftrace_enabled,
index 17bcad8f79de70a29fb58f84ce12ffb929515794..97325fbd62836f4fb477c4a2b2936eff544291ec 100644 (file)
@@ -2899,7 +2899,7 @@ static int set_max_user_events_sysctl(const struct ctl_table *table, int write,
        return ret;
 }
 
-static struct ctl_table user_event_sysctls[] = {
+static const struct ctl_table user_event_sysctls[] = {
        {
                .procname       = "user_events_max",
                .data           = &max_user_events,
index be92342707773127284d9a8588e6c06268b49139..b4da45a3a7cfca13de4a7ed562b4a25d110e2125 100644 (file)
@@ -544,7 +544,7 @@ static int proc_cap_handler(const struct ctl_table *table, int write,
        return 0;
 }
 
-static struct ctl_table usermodehelper_table[] = {
+static const struct ctl_table usermodehelper_table[] = {
        {
                .procname       = "bset",
                .data           = &usermodehelper_bset,
index 7282f61a8650fe0b5f4dfec22a055dbb9d5ee6ca..bfbaaecb1dd43f6ddfe2de6b7e128c5e76f23639 100644 (file)
@@ -75,7 +75,7 @@ static DEFINE_CTL_TABLE_POLL(hostname_poll);
 static DEFINE_CTL_TABLE_POLL(domainname_poll);
 
 // Note: update 'enum uts_proc' to match any changes to this table
-static struct ctl_table uts_kern_table[] = {
+static const struct ctl_table uts_kern_table[] = {
        {
                .procname       = "arch",
                .data           = init_uts_ns.name.machine,
@@ -129,7 +129,7 @@ static struct ctl_table uts_kern_table[] = {
  */
 void uts_proc_notify(enum uts_proc proc)
 {
-       struct ctl_table *table = &uts_kern_table[proc];
+       const struct ctl_table *table = &uts_kern_table[proc];
 
        proc_sys_poll_notify(table->poll);
 }
index 177abb7d0d4e55eb000a68bc98e7d93e1b89f72a..b2da7de39d06dd931ac214f230956096d60cdbef 100644 (file)
@@ -1094,7 +1094,7 @@ static int proc_watchdog_cpumask(const struct ctl_table *table, int write,
 
 static const int sixty = 60;
 
-static struct ctl_table watchdog_sysctls[] = {
+static const struct ctl_table watchdog_sysctls[] = {
        {
                .procname       = "watchdog",
                .data           = &watchdog_user_enabled,
index b6696fa1d4262e28c65f19edc67343401af86fbe..4249e0cc8aaff79d7da03aff81b3f9990e9eaac1 100644 (file)
@@ -71,7 +71,7 @@ static struct test_sysctl_data test_data = {
 };
 
 /* These are all under /proc/sys/debug/test_sysctl/ */
-static struct ctl_table test_table[] = {
+static const struct ctl_table test_table[] = {
        {
                .procname       = "int_0001",
                .data           = &test_data.int_0001,
@@ -177,7 +177,7 @@ static int test_sysctl_setup_node_tests(void)
 }
 
 /* Used to test that unregister actually removes the directory */
-static struct ctl_table test_table_unregister[] = {
+static const struct ctl_table test_table_unregister[] = {
        {
                .procname       = "unregister_error",
                .data           = &test_data.int_0001,
@@ -220,7 +220,7 @@ static int test_sysctl_run_register_mount_point(void)
        return 0;
 }
 
-static struct ctl_table test_table_empty[] = { };
+static const struct ctl_table test_table_empty[] = { };
 
 static int test_sysctl_run_register_empty(void)
 {
index 73e80b2fb22e5a560b038ce9169bafc2c25dfe42..bcc0df0066dc3ef5e4570a17adf44f098008ed49 100644 (file)
@@ -3272,7 +3272,7 @@ static int proc_dointvec_minmax_warn_RT_change(const struct ctl_table *table,
        return ret;
 }
 
-static struct ctl_table vm_compaction[] = {
+static const struct ctl_table vm_compaction[] = {
        {
                .procname       = "compact_memory",
                .data           = &sysctl_compact_memory,
index 87761b042ed04a96cb5502f777ef1d1d465bbd4f..3b25b69aa94f1d69ff34f6fd3dae70febb0faee5 100644 (file)
@@ -4867,7 +4867,7 @@ out:
        return ret;
 }
 
-static struct ctl_table hugetlb_table[] = {
+static const struct ctl_table hugetlb_table[] = {
        {
                .procname       = "nr_hugepages",
                .data           = NULL,
index 57b7f591eee82afccba8eadc1bc8fd68b3652c35..7735972add012e22dfbc154efad27d296086acc0 100644 (file)
@@ -693,7 +693,7 @@ void hugetlb_vmemmap_optimize_folios(struct hstate *h, struct list_head *folio_l
        free_vmemmap_page_list(&vmemmap_pages);
 }
 
-static struct ctl_table hugetlb_vmemmap_sysctls[] = {
+static const struct ctl_table hugetlb_vmemmap_sysctls[] = {
        {
                .procname       = "hugetlb_optimize_vmemmap",
                .data           = &vmemmap_optimize_enabled,
index a7b8ccd29b6f52d5e946051300d3f40820e94dee..995a15eb67e2c05e260cb8f028dcadf30cfead36 100644 (file)
@@ -124,7 +124,7 @@ const struct attribute_group memory_failure_attr_group = {
        .attrs = memory_failure_attr,
 };
 
-static struct ctl_table memory_failure_table[] = {
+static const struct ctl_table memory_failure_table[] = {
        {
                .procname       = "memory_failure_early_kill",
                .data           = &sysctl_memory_failure_early_kill,
index 044ebab2c9411b62ff94019f20370c72e26668b5..1cf121ad7085c740b0bc91eaacb48b037f9c1502 100644 (file)
@@ -705,7 +705,7 @@ static void queue_oom_reaper(struct task_struct *tsk)
 }
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table vm_oom_kill_table[] = {
+static const struct ctl_table vm_oom_kill_table[] = {
        {
                .procname       = "panic_on_oom",
                .data           = &sysctl_panic_on_oom,
index 4f5970723cf2a775bb98f63e1f0e83b1c9cc7ce4..eb55ece39c565d72108856b784fd3524c83620c4 100644 (file)
@@ -2298,7 +2298,7 @@ static int page_writeback_cpu_online(unsigned int cpu)
 /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
 static const unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
 
-static struct ctl_table vm_page_writeback_sysctls[] = {
+static const struct ctl_table vm_page_writeback_sysctls[] = {
        {
                .procname   = "dirty_background_ratio",
                .data       = &dirty_background_ratio,
index 6e469c7ef9a41abb406d014ec582e70bffa05b02..579789600a3c7bfb7b0d847d51af702a9d4b139a 100644 (file)
@@ -6166,7 +6166,7 @@ out:
        return ret;
 }
 
-static struct ctl_table page_alloc_sysctl_table[] = {
+static const struct ctl_table page_alloc_sysctl_table[] = {
        {
                .procname       = "min_free_kbytes",
                .data           = &min_free_kbytes,
index 1edc12862a7de20b1a24fa1eb85acee1a04d4661..9b6c2f157f83e837606f4c941e5c244679cc3ce2 100644 (file)
@@ -2038,7 +2038,7 @@ static int apparmor_dointvec(const struct ctl_table *table, int write,
        return proc_dointvec(table, write, buffer, lenp, ppos);
 }
 
-static struct ctl_table apparmor_sysctl_table[] = {
+static const struct ctl_table apparmor_sysctl_table[] = {
 #ifdef CONFIG_USER_NS
        {
                .procname       = "unprivileged_userns_apparmor_policy",
index 91f000eef3ad82370250e5238d9c9c80757aab61..cde08c478f3272081304e6db34e36b64ce0d321a 100644 (file)
@@ -9,7 +9,7 @@
 #include <linux/sysctl.h>
 #include "internal.h"
 
-static struct ctl_table key_sysctls[] = {
+static const struct ctl_table key_sysctls[] = {
        {
                .procname = "maxkeys",
                .data = &key_quota_maxkeys,
index 1a2d02fee09bf6db8b0a279c8fae0c3768a732b9..1971710620c184dc9d3f8078902ddc7d2ef2f523 100644 (file)
@@ -452,7 +452,7 @@ static int yama_dointvec_minmax(const struct ctl_table *table, int write,
 
 static int max_scope = YAMA_SCOPE_NO_ATTACH;
 
-static struct ctl_table yama_sysctl_table[] = {
+static const struct ctl_table yama_sysctl_table[] = {
        {
                .procname       = "ptrace_scope",
                .data           = &ptrace_scope,