linux/drivers/macintosh
Joel Granados 78eb4ea25c sysctl: treewide: constify the ctl_table argument of proc_handlers
const qualify the struct ctl_table argument in the proc_handler function
signatures. This is a prerequisite to moving the static ctl_table
structs into .rodata data which will ensure that proc_handler function
pointers cannot be modified.

This patch has been generated by the following coccinelle script:

```
  virtual patch

  @r1@
  identifier ctl, write, buffer, lenp, ppos;
  identifier func !~ "appldata_(timer|interval)_handler|sched_(rt|rr)_handler|rds_tcp_skbuf_handler|proc_sctp_do_(hmac_alg|rto_min|rto_max|udp_port|alpha_beta|auth|probe_interval)";
  @@

  int func(
  - struct ctl_table *ctl
  + const struct ctl_table *ctl
    ,int write, void *buffer, size_t *lenp, loff_t *ppos);

  @r2@
  identifier func, ctl, write, buffer, lenp, ppos;
  @@

  int func(
  - struct ctl_table *ctl
  + const struct ctl_table *ctl
    ,int write, void *buffer, size_t *lenp, loff_t *ppos)
  { ... }

  @r3@
  identifier func;
  @@

  int func(
  - struct ctl_table *
  + const struct ctl_table *
    ,int , void *, size_t *, loff_t *);

  @r4@
  identifier func, ctl;
  @@

  int func(
  - struct ctl_table *ctl
  + const struct ctl_table *ctl
    ,int , void *, size_t *, loff_t *);

  @r5@
  identifier func, write, buffer, lenp, ppos;
  @@

  int func(
  - struct ctl_table *
  + const struct ctl_table *
    ,int write, void *buffer, size_t *lenp, loff_t *ppos);

```

* Code formatting was adjusted in xfs_sysctl.c to comply with code
  conventions. The xfs_stats_clear_proc_handler,
  xfs_panic_mask_proc_handler and xfs_deprecated_dointvec_minmax where
  adjusted.

* The ctl_table argument in proc_watchdog_common was const qualified.
  This is called from a proc_handler itself and is calling back into
  another proc_handler, making it necessary to change it as part of the
  proc_handler migration.

Co-developed-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Co-developed-by: Joel Granados <j.granados@samsung.com>
Signed-off-by: Joel Granados <j.granados@samsung.com>
2024-07-24 20:59:29 +02:00
..
ams macintosh: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-06-28 22:08:05 +10:00
adb-iop.c
adb.c macintosh/adb: make adb_dev_class constant 2024-03-07 00:13:28 +11:00
adbhid.c
ans-lcd.c
ans-lcd.h
apm_emu.c
Kconfig macintosh/ams: Fix unused variable warning 2024-05-08 00:05:30 +10:00
mac_hid.c sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
macio_asic.c powerpc: pmac: make macio_bus_type const 2024-02-15 00:14:06 +11:00
macio_sysfs.c
macio-adb.c macintosh/macio-adb: replace of_node_put() with __free 2024-04-30 21:53:13 +10:00
Makefile
mediabay.c
rack-meter.c powerpc/macio: Make remove callback of macio driver void returned 2024-03-07 23:06:19 +11:00
smu.c macintosh: Explicitly include correct DT includes 2023-08-28 13:36:24 -05:00
therm_adt746x.c macintosh: Explicitly include correct DT includes 2023-08-28 13:36:24 -05:00
therm_windtunnel.c macintosh/therm_windtunnel: fix module unload. 2024-07-11 17:32:31 +10:00
via-cuda.c macintosh: Use of_address_to_resource() 2023-06-21 14:08:54 +10:00
via-macii.c macintosh/via-macii: Fix "BUG: sleeping function called from invalid context" 2024-04-29 16:45:53 +02:00
via-pmu-backlight.c macintosh/via-pmu-backlight: Include <linux/backlight.h> 2024-03-07 13:33:34 +01:00
via-pmu-event.c
via-pmu-event.h
via-pmu-led.c
via-pmu.c macintosh: Use of_address_to_resource() 2023-06-21 14:08:54 +10:00
windfarm_ad7417_sensor.c macintosh: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-06-28 22:08:05 +10:00
windfarm_core.c
windfarm_cpufreq_clamp.c
windfarm_fcu_controls.c macintosh: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-06-28 22:08:05 +10:00
windfarm_lm75_sensor.c macintosh: Explicitly include correct DT includes 2023-08-28 13:36:24 -05:00
windfarm_lm87_sensor.c macintosh: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-06-28 22:08:05 +10:00
windfarm_max6690_sensor.c macintosh: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-06-28 22:08:05 +10:00
windfarm_mpu.h
windfarm_pid.c
windfarm_pid.h macintosh/windfarm_pid: Add header file macro definition 2022-11-24 23:12:18 +11:00
windfarm_pm72.c macintosh: windfarm_pm72: Convert to platform remove callback returning void 2024-02-16 12:35:14 +11:00
windfarm_pm81.c macintosh: windfarm_pm81: Convert to platform remove callback returning void 2024-02-16 12:35:14 +11:00
windfarm_pm91.c macintosh: windfarm_pm91: Convert to platform remove callback returning void 2024-02-16 12:35:15 +11:00
windfarm_pm112.c macintosh: windfarm_pm112: Convert to platform remove callback returning void 2024-02-16 12:35:14 +11:00
windfarm_pm121.c macintosh: windfarm_pm121: Convert to platform remove callback returning void 2024-02-16 12:35:14 +11:00
windfarm_rm31.c macintosh: windfarm_rm31: Convert to platform remove callback returning void 2024-02-16 12:35:15 +11:00
windfarm_smu_controls.c macintosh: Switch to use for_each_child_of_node() macro 2022-11-24 23:12:18 +11:00
windfarm_smu_sat.c macintosh: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-06-28 22:08:05 +10:00
windfarm_smu_sensors.c macintosh: windfarm: Use unsigned type for 1-bit bitfields 2023-02-16 10:16:31 +11:00
windfarm.h