2024-02-25 04:09:09

by Wen Yang

[permalink] [raw]
Subject: [PATCH 6/8] epoll: delete these duplicate static variables long_zero and long_max

From: Wen Yang <[email protected]>

Since these static variables (long_zero and long_max) are only used for
boundary checks and will not be changed, remove it and use the ones in
our shared const array.

Signed-off-by: Wen Yang <[email protected]>
Cc: Luis Chamberlain <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Joel Granados <[email protected]>
Cc: Christian Brauner <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: "Darrick J. Wong" <[email protected]>
Cc: [email protected]
---
fs/eventpoll.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 3534d36a1474..22864d6de04f 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -309,9 +309,6 @@ static void unlist_file(struct epitems_head *head)

#include <linux/sysctl.h>

-static long long_zero;
-static long long_max = LONG_MAX;
-
static struct ctl_table epoll_table[] = {
{
.procname = "max_user_watches",
@@ -319,8 +316,8 @@ static struct ctl_table epoll_table[] = {
.maxlen = sizeof(max_user_watches),
.mode = 0644,
.proc_handler = proc_doulongvec_minmax,
- .extra1 = &long_zero,
- .extra2 = &long_max,
+ .extra1 = SYSCTL_LONG_ZERO,
+ .extra2 = SYSCTL_LONG_MAX,
},
};

--
2.25.1