Skip to content
/ linux Public

Commit 2efc983

Browse files
gthelenSasha Levin
authored andcommitted
selftests/memfd: delete unused declarations
[ Upstream commit a9117b4 ] Commit 32d118a ("selftests/memfd: add tests for F_SEAL_EXEC"): - added several unused 'nbytes' local variables Commit 6469b66 ("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.com Signed-off-by: Greg 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: Andrew Morton <akpm@linux-foundation.org> Stable-dep-of: b243355 ("selftests/memfd: use IPC semaphore instead of SIGSTOP/SIGCONT") Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d809ee1 commit 2efc983

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

tools/testing/selftests/memfd/memfd_test.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545
*/
4646
static size_t mfd_def_size = MFD_DEF_SIZE;
4747
static const char *memfd_str = MEMFD_STR;
48-
static int newpid_thread_fn2(void *arg);
49-
static void join_newpid_thread(pid_t pid);
5048

5149
static ssize_t fd2name(int fd, char *buf, size_t bufsize)
5250
{
@@ -195,7 +193,6 @@ static unsigned int mfd_assert_get_seals(int fd)
195193
static void mfd_assert_has_seals(int fd, unsigned int seals)
196194
{
197195
char buf[PATH_MAX];
198-
int nbytes;
199196
unsigned int s;
200197
fd2name(fd, buf, PATH_MAX);
201198

@@ -715,7 +712,6 @@ static void mfd_assert_mode(int fd, int mode)
715712
{
716713
struct stat st;
717714
char buf[PATH_MAX];
718-
int nbytes;
719715

720716
fd2name(fd, buf, PATH_MAX);
721717

@@ -734,7 +730,6 @@ static void mfd_assert_mode(int fd, int mode)
734730
static void mfd_assert_chmod(int fd, int mode)
735731
{
736732
char buf[PATH_MAX];
737-
int nbytes;
738733

739734
fd2name(fd, buf, PATH_MAX);
740735

@@ -750,7 +745,6 @@ static void mfd_fail_chmod(int fd, int mode)
750745
{
751746
struct stat st;
752747
char buf[PATH_MAX];
753-
int nbytes;
754748

755749
fd2name(fd, buf, PATH_MAX);
756750

@@ -1297,9 +1291,6 @@ static void test_sysctl_set_sysctl2(void)
12971291

12981292
static int sysctl_simple_child(void *arg)
12991293
{
1300-
int fd;
1301-
int pid;
1302-
13031294
printf("%s sysctl 0\n", memfd_str);
13041295
test_sysctl_set_sysctl0();
13051296

@@ -1364,7 +1355,6 @@ static void test_sysctl_sysctl2_failset(void)
13641355

13651356
static int sysctl_nested_child(void *arg)
13661357
{
1367-
int fd;
13681358
int pid;
13691359

13701360
printf("%s nested sysctl 0\n", memfd_str);

0 commit comments

Comments
 (0)