sysctl: Update API function documentation

Add colon ":" after argument name where it is missing
Add doc for proc_int_conv and proc_dointvec_conv

Signed-off-by: Joel Granados <joel.granados@kernel.org>
This commit is contained in:
Joel Granados 2026-06-25 22:38:21 +02:00
parent b1ca9dae82
commit f692bc3598

View File

@ -365,7 +365,7 @@ static void proc_put_char(void **buf, size_t *size, char c)
* not NULL. Check that the values are less than UINT_MAX to avoid
* having to support wrap around from userspace.
*
* returns 0 on success.
* Returns: 0 on success.
*/
int proc_uint_u2k_conv_uop(const ulong *u_ptr, uint *k_ptr,
ulong (*u_ptr_op)(const ulong))
@ -386,7 +386,7 @@ int proc_uint_u2k_conv_uop(const ulong *u_ptr, uint *k_ptr,
*
* Uses READ_ONCE to assign value to u_ptr.
*
* returns 0 on success.
* Returns: 0 on success.
*/
int proc_uint_k2u_conv(ulong *u_ptr, const uint *k_ptr)
{
@ -515,6 +515,23 @@ int proc_int_u2k_conv_uop(const ulong *u_ptr, int *k_ptr, const bool *negp,
return 0;
}
/**
* proc_int_conv - Change user or kernel pointer based on direction
*
* @negp: will be passed to uni-directional converters
* @u_ptr: pointer to user variable
* @k_ptr: pointer to kernel variable
* @dir: %TRUE if this is a write to the sysctl file
* @tbl: the sysctl table
* @k_ptr_range_check: Check range for k_ptr when %TRUE
* @user_to_kern: Callback used to assign value from user to kernel var
* @kern_to_user: Callback used to assign value from kernel to user var
*
* When direction is kernel to user, then the u_ptr is modified.
* When direction is user to kernel, then the k_ptr is modified.
*
* Returns: 0 on success
*/
int proc_int_conv(bool *negp, ulong *u_ptr, int *k_ptr, int dir,
const struct ctl_table *tbl, bool k_ptr_range_check,
int (*user_to_kern)(const bool *negp, const ulong *u_ptr, int *k_ptr),
@ -975,7 +992,7 @@ int proc_ulong_conv(ulong *u_ptr, ulong *k_ptr, int dir,
* Uses WRITE_ONCE to assign value to k_ptr. Executes u_ptr_op if
* not NULL.
*
* returns: 0 on success.
* Returns: 0 on success.
*/
int proc_ulong_u2k_conv_uop(const ulong *u_ptr, ulong *k_ptr,
ulong (*u_ptr_op)(const ulong))
@ -1001,7 +1018,7 @@ static int proc_ulong_u2k_conv(const ulong *u_ptr, ulong *k_ptr)
* Uses READ_ONCE to assign value to u_ptr. Executes k_ptr_op if
* not NULL.
*
* returns: 0 on success.
* Returns: 0 on success.
*/
int proc_ulong_k2u_conv_kop(ulong *u_ptr, const ulong *k_ptr,
ulong (*k_ptr_op)(const ulong))
@ -1078,15 +1095,13 @@ int proc_doulongvec_minmax(const struct ctl_table *table, int dir,
* @buffer: the user buffer
* @lenp: the size of the user buffer
* @ppos: file position
* @conv: Custom converter call back
* @conv: Custom converter call back. Defaults to do_proc_int_conv
*
* Reads/writes up to table->maxlen/sizeof(unsigned int) unsigned integer
* values from/to the user buffer, treated as an ASCII string. Negative
* strings are not allowed.
* Reads/writes up to table->maxlen/sizeof(int) integer values from/to the
* user buffer, treated as an ASCII string.
*
* Returns: 0 on success
*/
int proc_dointvec_conv(const struct ctl_table *table, int dir, void *buffer,
size_t *lenp, loff_t *ppos,
int (*conv)(bool *negp, unsigned long *u_ptr, int *k_ptr,