@@ -253,7 +253,7 @@ static struct ctl_table riscv_v_default_vstate_table[] = {
.data = &riscv_v_implicit_uacc,
.maxlen = sizeof(riscv_v_implicit_uacc),
.mode = 0644,
- .proc_handler = proc_dobool,
+ .proc_handler_new = proc_dobool,
},
};
@@ -3601,7 +3601,7 @@ static struct ctl_table tty_table[] = {
.data = &tty_legacy_tiocsti,
.maxlen = sizeof(tty_legacy_tiocsti),
.mode = 0644,
- .proc_handler = proc_dobool,
+ .proc_handler_new = proc_dobool,
},
{
.procname = "ldisc_autoload",
@@ -466,7 +466,7 @@ static struct ctl_table nlm_sysctls[] = {
.data = &nsm_use_hostnames,
.maxlen = sizeof(bool),
.mode = 0644,
- .proc_handler = proc_dobool,
+ .proc_handler_new = proc_dobool,
},
{
.procname = "nsm_local_state",
@@ -1119,7 +1119,7 @@ static int sysctl_check_table_array(const char *path, struct ctl_table *table)
err |= sysctl_err(path, table, "array not allowed");
}
- if (table->proc_handler == proc_dobool) {
+ if (table->proc_handler_new == proc_dobool) {
if (table->maxlen != sizeof(bool))
err |= sysctl_err(path, table, "array not allowed");
}
@@ -1133,7 +1133,7 @@ static int sysctl_check_table(const char *path, struct ctl_table_header *header)
int err = 0;
list_for_each_table_entry(entry, header) {
if ((entry->proc_handler_new == proc_dostring) ||
- (entry->proc_handler == proc_dobool) ||
+ (entry->proc_handler_new == proc_dobool) ||
(entry->proc_handler == proc_dointvec) ||
(entry->proc_handler == proc_douintvec) ||
(entry->proc_handler == proc_douintvec_minmax) ||
@@ -67,7 +67,7 @@ typedef int proc_handler_new(const struct ctl_table *ctl, int write,
void *buffer, size_t *lenp, loff_t *ppos);
int proc_dostring(const struct ctl_table *, int, void *, size_t *, loff_t *);
-int proc_dobool(struct ctl_table *table, int write, void *buffer,
+int proc_dobool(const struct ctl_table *table, int write, void *buffer,
size_t *lenp, loff_t *ppos);
int proc_dointvec(struct ctl_table *, int, void *, size_t *, loff_t *);
int proc_douintvec(struct ctl_table *, int, void *, size_t *, loff_t *);
@@ -702,7 +702,7 @@ int do_proc_douintvec(struct ctl_table *table, int write,
*
* Returns 0 on success.
*/
-int proc_dobool(struct ctl_table *table, int write, void *buffer,
+int proc_dobool(const struct ctl_table *table, int write, void *buffer,
size_t *lenp, loff_t *ppos)
{
struct ctl_table tmp;
@@ -1504,7 +1504,7 @@ int proc_dostring(const struct ctl_table *table, int write,
return -ENOSYS;
}
-int proc_dobool(struct ctl_table *table, int write,
+int proc_dobool(const struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
return -ENOSYS;
@@ -779,7 +779,7 @@ static struct ctl_table hugetlb_vmemmap_sysctls[] = {
.data = &vmemmap_optimize_enabled,
.maxlen = sizeof(vmemmap_optimize_enabled),
.mode = 0644,
- .proc_handler = proc_dobool,
+ .proc_handler_new = proc_dobool,
},
{ }
};
proc_handler_new() prevents the handler function from modifying the ctl_table which then can be put into .rodata. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> --- arch/riscv/kernel/vector.c | 2 +- drivers/tty/tty_io.c | 2 +- fs/lockd/svc.c | 2 +- fs/proc/proc_sysctl.c | 4 ++-- include/linux/sysctl.h | 2 +- kernel/sysctl.c | 4 ++-- mm/hugetlb_vmemmap.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-)