Commit a9117b4d authored by Greg Thelen's avatar Greg Thelen Committed by Andrew Morton

selftests/memfd: delete unused declarations

Commit 32d118ad ("selftests/memfd: add tests for F_SEAL_EXEC"):
- added several unused 'nbytes' local variables

Commit 6469b66e ("selftests: improve vm.memfd_noexec sysctl tests"):
- orphaned 'newpid_thread_fn2()' forward declaration
- orphaned 'join_newpid_thread()' forward declaration
- added unused 'pid' local in sysctl_simple_child()
- orphaned 'fd' local in sysctl_simple_child()
- added unused 'fd' in sysctl_nested_child()

Delete the unused locals and forward declarations.

Link: https://lkml.kernel.org/r/20240118095057.677544-1-gthelen@google.comSigned-off-by: default avatarGreg Thelen <gthelen@google.com>
Cc: Aleksa Sarai <cyphar@cyphar.com>
Cc: Daniel Verkamp <dverkamp@chromium.org>
Cc: Jeff Xu <jeffxu@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent d9b3ce87
...@@ -44,8 +44,6 @@ ...@@ -44,8 +44,6 @@
*/ */
static size_t mfd_def_size = MFD_DEF_SIZE; static size_t mfd_def_size = MFD_DEF_SIZE;
static const char *memfd_str = MEMFD_STR; static const char *memfd_str = MEMFD_STR;
static int newpid_thread_fn2(void *arg);
static void join_newpid_thread(pid_t pid);
static ssize_t fd2name(int fd, char *buf, size_t bufsize) static ssize_t fd2name(int fd, char *buf, size_t bufsize)
{ {
...@@ -194,7 +192,6 @@ static unsigned int mfd_assert_get_seals(int fd) ...@@ -194,7 +192,6 @@ static unsigned int mfd_assert_get_seals(int fd)
static void mfd_assert_has_seals(int fd, unsigned int seals) static void mfd_assert_has_seals(int fd, unsigned int seals)
{ {
char buf[PATH_MAX]; char buf[PATH_MAX];
int nbytes;
unsigned int s; unsigned int s;
fd2name(fd, buf, PATH_MAX); fd2name(fd, buf, PATH_MAX);
...@@ -696,7 +693,6 @@ static void mfd_assert_mode(int fd, int mode) ...@@ -696,7 +693,6 @@ static void mfd_assert_mode(int fd, int mode)
{ {
struct stat st; struct stat st;
char buf[PATH_MAX]; char buf[PATH_MAX];
int nbytes;
fd2name(fd, buf, PATH_MAX); fd2name(fd, buf, PATH_MAX);
...@@ -715,7 +711,6 @@ static void mfd_assert_mode(int fd, int mode) ...@@ -715,7 +711,6 @@ static void mfd_assert_mode(int fd, int mode)
static void mfd_assert_chmod(int fd, int mode) static void mfd_assert_chmod(int fd, int mode)
{ {
char buf[PATH_MAX]; char buf[PATH_MAX];
int nbytes;
fd2name(fd, buf, PATH_MAX); fd2name(fd, buf, PATH_MAX);
...@@ -731,7 +726,6 @@ static void mfd_fail_chmod(int fd, int mode) ...@@ -731,7 +726,6 @@ static void mfd_fail_chmod(int fd, int mode)
{ {
struct stat st; struct stat st;
char buf[PATH_MAX]; char buf[PATH_MAX];
int nbytes;
fd2name(fd, buf, PATH_MAX); fd2name(fd, buf, PATH_MAX);
...@@ -1254,9 +1248,6 @@ static void test_sysctl_set_sysctl2(void) ...@@ -1254,9 +1248,6 @@ static void test_sysctl_set_sysctl2(void)
static int sysctl_simple_child(void *arg) static int sysctl_simple_child(void *arg)
{ {
int fd;
int pid;
printf("%s sysctl 0\n", memfd_str); printf("%s sysctl 0\n", memfd_str);
test_sysctl_set_sysctl0(); test_sysctl_set_sysctl0();
...@@ -1321,7 +1312,6 @@ static void test_sysctl_sysctl2_failset(void) ...@@ -1321,7 +1312,6 @@ static void test_sysctl_sysctl2_failset(void)
static int sysctl_nested_child(void *arg) static int sysctl_nested_child(void *arg)
{ {
int fd;
int pid; int pid;
printf("%s nested sysctl 0\n", memfd_str); printf("%s nested sysctl 0\n", memfd_str);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment