Commit 32fe9152 authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Joel Granados

sysctl: constify ctl_table arguments of utility function

In a future commit the proc_handlers themselves will change to
"const struct ctl_table". As a preparation for that adapt the internal
helper.
Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarJoel Granados <j.granados@samsung.com>
parent 4154342b
...@@ -237,7 +237,7 @@ extern struct ctl_table_header *register_sysctl_mount_point(const char *path); ...@@ -237,7 +237,7 @@ extern struct ctl_table_header *register_sysctl_mount_point(const char *path);
void do_sysctl_args(void); void do_sysctl_args(void);
bool sysctl_is_alias(char *param); bool sysctl_is_alias(char *param);
int do_proc_douintvec(struct ctl_table *table, int write, int do_proc_douintvec(const struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos, void *buffer, size_t *lenp, loff_t *ppos,
int (*conv)(unsigned long *lvalp, int (*conv)(unsigned long *lvalp,
unsigned int *valp, unsigned int *valp,
......
...@@ -205,7 +205,7 @@ static int _proc_do_string(char *data, int maxlen, int write, ...@@ -205,7 +205,7 @@ static int _proc_do_string(char *data, int maxlen, int write,
return 0; return 0;
} }
static void warn_sysctl_write(struct ctl_table *table) static void warn_sysctl_write(const struct ctl_table *table)
{ {
pr_warn_once("%s wrote to %s when file position was not 0!\n" pr_warn_once("%s wrote to %s when file position was not 0!\n"
"This will not be supported in the future. To silence this\n" "This will not be supported in the future. To silence this\n"
...@@ -223,7 +223,7 @@ static void warn_sysctl_write(struct ctl_table *table) ...@@ -223,7 +223,7 @@ static void warn_sysctl_write(struct ctl_table *table)
* handlers can ignore the return value. * handlers can ignore the return value.
*/ */
static bool proc_first_pos_non_zero_ignore(loff_t *ppos, static bool proc_first_pos_non_zero_ignore(loff_t *ppos,
struct ctl_table *table) const struct ctl_table *table)
{ {
if (!*ppos) if (!*ppos)
return false; return false;
...@@ -468,7 +468,7 @@ static int do_proc_douintvec_conv(unsigned long *lvalp, ...@@ -468,7 +468,7 @@ static int do_proc_douintvec_conv(unsigned long *lvalp,
static const char proc_wspace_sep[] = { ' ', '\t', '\n' }; static const char proc_wspace_sep[] = { ' ', '\t', '\n' };
static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, static int __do_proc_dointvec(void *tbl_data, const struct ctl_table *table,
int write, void *buffer, int write, void *buffer,
size_t *lenp, loff_t *ppos, size_t *lenp, loff_t *ppos,
int (*conv)(bool *negp, unsigned long *lvalp, int *valp, int (*conv)(bool *negp, unsigned long *lvalp, int *valp,
...@@ -541,7 +541,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, ...@@ -541,7 +541,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
return err; return err;
} }
static int do_proc_dointvec(struct ctl_table *table, int write, static int do_proc_dointvec(const struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos, void *buffer, size_t *lenp, loff_t *ppos,
int (*conv)(bool *negp, unsigned long *lvalp, int *valp, int (*conv)(bool *negp, unsigned long *lvalp, int *valp,
int write, void *data), int write, void *data),
...@@ -552,7 +552,7 @@ static int do_proc_dointvec(struct ctl_table *table, int write, ...@@ -552,7 +552,7 @@ static int do_proc_dointvec(struct ctl_table *table, int write,
} }
static int do_proc_douintvec_w(unsigned int *tbl_data, static int do_proc_douintvec_w(unsigned int *tbl_data,
struct ctl_table *table, const struct ctl_table *table,
void *buffer, void *buffer,
size_t *lenp, loff_t *ppos, size_t *lenp, loff_t *ppos,
int (*conv)(unsigned long *lvalp, int (*conv)(unsigned long *lvalp,
...@@ -639,7 +639,7 @@ static int do_proc_douintvec_r(unsigned int *tbl_data, void *buffer, ...@@ -639,7 +639,7 @@ static int do_proc_douintvec_r(unsigned int *tbl_data, void *buffer,
return err; return err;
} }
static int __do_proc_douintvec(void *tbl_data, struct ctl_table *table, static int __do_proc_douintvec(void *tbl_data, const struct ctl_table *table,
int write, void *buffer, int write, void *buffer,
size_t *lenp, loff_t *ppos, size_t *lenp, loff_t *ppos,
int (*conv)(unsigned long *lvalp, int (*conv)(unsigned long *lvalp,
...@@ -675,7 +675,7 @@ static int __do_proc_douintvec(void *tbl_data, struct ctl_table *table, ...@@ -675,7 +675,7 @@ static int __do_proc_douintvec(void *tbl_data, struct ctl_table *table,
return do_proc_douintvec_r(i, buffer, lenp, ppos, conv, data); return do_proc_douintvec_r(i, buffer, lenp, ppos, conv, data);
} }
int do_proc_douintvec(struct ctl_table *table, int write, int do_proc_douintvec(const struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos, void *buffer, size_t *lenp, loff_t *ppos,
int (*conv)(unsigned long *lvalp, int (*conv)(unsigned long *lvalp,
unsigned int *valp, unsigned int *valp,
...@@ -1017,8 +1017,9 @@ static int sysrq_sysctl_handler(struct ctl_table *table, int write, ...@@ -1017,8 +1017,9 @@ static int sysrq_sysctl_handler(struct ctl_table *table, int write,
} }
#endif #endif
static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, static int __do_proc_doulongvec_minmax(void *data,
int write, void *buffer, size_t *lenp, loff_t *ppos, const struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos,
unsigned long convmul, unsigned long convdiv) unsigned long convmul, unsigned long convdiv)
{ {
unsigned long *i, *min, *max; unsigned long *i, *min, *max;
...@@ -1090,7 +1091,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, ...@@ -1090,7 +1091,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table,
return err; return err;
} }
static int do_proc_doulongvec_minmax(struct ctl_table *table, int write, static int do_proc_doulongvec_minmax(const struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos, unsigned long convmul, void *buffer, size_t *lenp, loff_t *ppos, unsigned long convmul,
unsigned long convdiv) unsigned long convdiv)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment