lkml.org 
[lkml]   [2024]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 9/9] ucounts: delete these unnecessary static variables ue_zero and ue_int_max
Date
From: Wen Yang <wenyang.linux@foxmail.com>

Delete unnecessary static variables (ue_zero and ue_int_max)
and encode them directly in the table entry.

Signed-off-by: Wen Yang <wenyang.linux@foxmail.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Joel Granados <j.granados@samsung.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org
---
kernel/ucount.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/kernel/ucount.c b/kernel/ucount.c
index e188c25ed2b3..53d96cb27309 100644
--- a/kernel/ucount.c
+++ b/kernel/ucount.c
@@ -58,17 +58,15 @@ static struct ctl_table_root set_root = {
.permissions = set_permissions,
};

-static long ue_zero = 0;
-static long ue_int_max = INT_MAX;
-
#define UCOUNT_ENTRY(name) \
{ \
.procname = name, \
.maxlen = sizeof(long), \
.mode = 0644, \
.proc_handler = proc_doulongvec_minmax, \
- .extra1 = &ue_zero, \
- .extra2 = &ue_int_max, \
+ .min = SYSCTL_NUMERIC_ZERO, \
+ .max = SYSCTL_NUMERIC_INT_MAX, \
+ .extra_flags = SYSCTL_TABLE_EXTRA_LONG_INIT_MINMAX \
}
static struct ctl_table user_table[] = {
UCOUNT_ENTRY("max_user_namespaces"),
--
2.25.1

\
 
 \ /
  Last update: 2024-05-27 15:43    [W:0.047 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site