[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tencent_1FBC930BE9F1CC5E7E0BCF7955BFD4E54108@qq.com>
Date: Tue, 19 Mar 2024 23:57:50 +0800
From: wenyang.linux@...mail.com
To: "Eric W . Biederman" <ebiederm@...ssion.com>,
Luis Chamberlain <mcgrof@...nel.org>,
Kees Cook <keescook@...omium.org>,
Joel Granados <j.granados@...sung.com>,
Christian Brauner <brauner@...nel.org>
Cc: Dave Young <dyoung@...hat.com>,
Wen Yang <wenyang.linux@...mail.com>,
Shuah Khan <skhan@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Subject: [RESEND PATCH v2 9/9] ucounts: delete these unnecessary static variables ue_zero and ue_int_max
From: Wen Yang <wenyang.linux@...mail.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@...mail.com>
Cc: Eric W. Biederman <ebiederm@...ssion.com>
Cc: Luis Chamberlain <mcgrof@...nel.org>
Cc: Kees Cook <keescook@...omium.org>
Cc: Joel Granados <j.granados@...sung.com>
Cc: Christian Brauner <brauner@...nel.org>
Cc: Shuah Khan <skhan@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org
---
kernel/ucount.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/kernel/ucount.c b/kernel/ucount.c
index 4aa6166cb856..f1c7a160f361 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
Powered by blists - more mailing lists