Skip to content

Commit a9117b4

Browse files
gthelenakpm00
authored andcommitted
selftests/memfd: delete unused declarations
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/[email protected] Signed-off-by: Greg Thelen <[email protected]> Cc: Aleksa Sarai <[email protected]> Cc: Daniel Verkamp <[email protected]> Cc: Jeff Xu <[email protected]> Cc: Kees Cook <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent d9b3ce8 commit a9117b4

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
@@ -44,8 +44,6 @@
4444
*/
4545
static size_t mfd_def_size = MFD_DEF_SIZE;
4646
static const char *memfd_str = MEMFD_STR;
47-
static int newpid_thread_fn2(void *arg);
48-
static void join_newpid_thread(pid_t pid);
4947

5048
static ssize_t fd2name(int fd, char *buf, size_t bufsize)
5149
{
@@ -194,7 +192,6 @@ static unsigned int mfd_assert_get_seals(int fd)
194192
static void mfd_assert_has_seals(int fd, unsigned int seals)
195193
{
196194
char buf[PATH_MAX];
197-
int nbytes;
198195
unsigned int s;
199196
fd2name(fd, buf, PATH_MAX);
200197

@@ -696,7 +693,6 @@ static void mfd_assert_mode(int fd, int mode)
696693
{
697694
struct stat st;
698695
char buf[PATH_MAX];
699-
int nbytes;
700696

701697
fd2name(fd, buf, PATH_MAX);
702698

@@ -715,7 +711,6 @@ static void mfd_assert_mode(int fd, int mode)
715711
static void mfd_assert_chmod(int fd, int mode)
716712
{
717713
char buf[PATH_MAX];
718-
int nbytes;
719714

720715
fd2name(fd, buf, PATH_MAX);
721716

@@ -731,7 +726,6 @@ static void mfd_fail_chmod(int fd, int mode)
731726
{
732727
struct stat st;
733728
char buf[PATH_MAX];
734-
int nbytes;
735729

736730
fd2name(fd, buf, PATH_MAX);
737731

@@ -1254,9 +1248,6 @@ static void test_sysctl_set_sysctl2(void)
12541248

12551249
static int sysctl_simple_child(void *arg)
12561250
{
1257-
int fd;
1258-
int pid;
1259-
12601251
printf("%s sysctl 0\n", memfd_str);
12611252
test_sysctl_set_sysctl0();
12621253

@@ -1321,7 +1312,6 @@ static void test_sysctl_sysctl2_failset(void)
13211312

13221313
static int sysctl_nested_child(void *arg)
13231314
{
1324-
int fd;
13251315
int pid;
13261316

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

0 commit comments

Comments
 (0)