From 30baaeb685bce0b7dfd3c5a55f22b1076c21f7b2 Mon Sep 17 00:00:00 2001 From: Joel Granados Date: Tue, 14 Oct 2025 14:21:03 +0200 Subject: sysctl: Create pipe-max-size converter using sysctl UINT macros Create a converter for the pipe-max-size proc_handler using the SYSCTL_UINT_CONV_CUSTOM. Move SYSCTL_CONV_IDENTITY macro to the sysctl header to make it available for pipe size validation. Keep returning -EINVAL when (val == 0) by using a range checking converter and setting the minimal valid value (extern1) to SYSCTL_ONE. Keep round_pipe_size by passing it as the operation for SYSCTL_USER_TO_KERN_INT_CONV. Signed-off-by: Joel Granados --- kernel/sysctl.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'kernel') diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 998400323ae9..d09c6602a115 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -354,8 +354,6 @@ static void proc_put_char(void **buf, size_t *size, char c) } } -#define SYSCTL_CONV_IDENTITY(val) val - static SYSCTL_USER_TO_KERN_INT_CONV(, SYSCTL_CONV_IDENTITY) static SYSCTL_KERN_TO_USER_INT_CONV(, SYSCTL_CONV_IDENTITY) -- cgit v1.2.3