mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
sysctl: Move default converter assignment out of do_proc_dointvec
Move the converter assignment out of do_proc_dointvec into the caller. Both the test for NULL and the assignment are meant to stay within the sysctl.c context. This is in preparation of using a typed macro to for the integer proc vector function. Signed-off-by: Joel Granados <joel.granados@kernel.org>
This commit is contained in:
parent
8cdeaa50ea
commit
c2b8f4930a
|
|
@ -591,9 +591,6 @@ static int do_proc_dointvec(const struct ctl_table *table, int dir,
|
|||
vleft = table->maxlen / sizeof(*i);
|
||||
left = *lenp;
|
||||
|
||||
if (!conv)
|
||||
conv = do_proc_int_conv;
|
||||
|
||||
if (SYSCTL_USER_TO_KERN(dir)) {
|
||||
if (proc_first_pos_non_zero_ignore(ppos, table))
|
||||
goto out;
|
||||
|
|
@ -840,7 +837,7 @@ int proc_dobool(const struct ctl_table *table, int dir, void *buffer,
|
|||
int proc_dointvec(const struct ctl_table *table, int dir, void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return do_proc_dointvec(table, dir, buffer, lenp, ppos, NULL);
|
||||
return do_proc_dointvec(table, dir, buffer, lenp, ppos, do_proc_int_conv);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1090,6 +1087,8 @@ int proc_dointvec_conv(const struct ctl_table *table, int dir, void *buffer,
|
|||
int (*conv)(bool *negp, unsigned long *u_ptr, int *k_ptr,
|
||||
int dir, const struct ctl_table *table))
|
||||
{
|
||||
if (!conv)
|
||||
conv = do_proc_int_conv;
|
||||
return do_proc_dointvec(table, dir, buffer, lenp, ppos, conv);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user