[PATCH] ucounts: constify sysctl table user_table

Thomas Weißschuh posted 1 patch 1 year, 3 months ago
kernel/ucount.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] ucounts: constify sysctl table user_table
Posted by Thomas Weißschuh 1 year, 3 months ago
The data of user_table is never modified,
but only used as a template to create copies from.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
kernel/ucount.c has no proper maintainer.
This patch is meant for the sysctl tree.
---
 kernel/ucount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/ucount.c b/kernel/ucount.c
index 8c07714ff27d..4f6dd1a30117 100644
--- a/kernel/ucount.c
+++ b/kernel/ucount.c
@@ -70,7 +70,7 @@ static long ue_int_max = INT_MAX;
 		.extra1		= &ue_zero,			\
 		.extra2		= &ue_int_max,			\
 	}
-static struct ctl_table user_table[] = {
+static const struct ctl_table user_table[] = {
 	UCOUNT_ENTRY("max_user_namespaces"),
 	UCOUNT_ENTRY("max_pid_namespaces"),
 	UCOUNT_ENTRY("max_uts_namespaces"),

---
base-commit: d2bafcf224f3911b183113b2fcb536c9e90684a3
change-id: 20240805-sysctl-const-ucount-5da084520770

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>

Re: [PATCH] ucounts: constify sysctl table user_table
Posted by Joel Granados 1 year, 1 month ago
On Sun, Aug 25, 2024 at 12:53:14PM +0200, Thomas Weißschuh wrote:
> The data of user_table is never modified,
> but only used as a template to create copies from.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> kernel/ucount.c has no proper maintainer.
> This patch is meant for the sysctl tree.
> ---
>  kernel/ucount.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/ucount.c b/kernel/ucount.c
> index 8c07714ff27d..4f6dd1a30117 100644
> --- a/kernel/ucount.c
> +++ b/kernel/ucount.c
> @@ -70,7 +70,7 @@ static long ue_int_max = INT_MAX;
>  		.extra1		= &ue_zero,			\
>  		.extra2		= &ue_int_max,			\
>  	}
> -static struct ctl_table user_table[] = {
> +static const struct ctl_table user_table[] = {
>  	UCOUNT_ENTRY("max_user_namespaces"),
>  	UCOUNT_ENTRY("max_pid_namespaces"),
>  	UCOUNT_ENTRY("max_uts_namespaces"),
> 
> ---
> base-commit: d2bafcf224f3911b183113b2fcb536c9e90684a3
> change-id: 20240805-sysctl-const-ucount-5da084520770
> 
> Best regards,
> -- 
> Thomas Weißschuh <linux@weissschuh.net>
> 
Makes total sense.

thx

Signed-off-by: Joel Granados <joel.granados@kernel.org>

-- 

Joel Granados