Commit f545605c authored by John Hubbard's avatar John Hubbard Committed by Linus Torvalds

selftests/vm: minor cleanup: Makefile and gup_test.c

A few cleanups that don't deserve separate patches, but that also should
not clutter up other functional changes:

1. Remove an unnecessary #include <prctl.h>

2. Restore the sorted order of TEST_GEN_FILES.

3. Add -lpthread to the common LDLIBS, as it is harmless and several
   tests use it. This gets rid of one special rule already.

Link: https://lkml.kernel.org/r/20201026064021.3545418-5-jhubbard@nvidia.comSigned-off-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c2aa8afc
...@@ -21,14 +21,15 @@ MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/') ...@@ -21,14 +21,15 @@ MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/')
MAKEFLAGS += --no-builtin-rules MAKEFLAGS += --no-builtin-rules
CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS) CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS)
LDLIBS = -lrt LDLIBS = -lrt -lpthread
TEST_GEN_FILES = compaction_test TEST_GEN_FILES = compaction_test
TEST_GEN_FILES += gup_test TEST_GEN_FILES += gup_test
TEST_GEN_FILES += hmm-tests TEST_GEN_FILES += hmm-tests
TEST_GEN_FILES += hugepage-mmap TEST_GEN_FILES += hugepage-mmap
TEST_GEN_FILES += hugepage-shm TEST_GEN_FILES += hugepage-shm
TEST_GEN_FILES += map_hugetlb TEST_GEN_FILES += khugepaged
TEST_GEN_FILES += map_fixed_noreplace TEST_GEN_FILES += map_fixed_noreplace
TEST_GEN_FILES += map_hugetlb
TEST_GEN_FILES += map_populate TEST_GEN_FILES += map_populate
TEST_GEN_FILES += mlock-random-test TEST_GEN_FILES += mlock-random-test
TEST_GEN_FILES += mlock2-tests TEST_GEN_FILES += mlock2-tests
...@@ -37,7 +38,6 @@ TEST_GEN_FILES += on-fault-limit ...@@ -37,7 +38,6 @@ TEST_GEN_FILES += on-fault-limit
TEST_GEN_FILES += thuge-gen TEST_GEN_FILES += thuge-gen
TEST_GEN_FILES += transhuge-stress TEST_GEN_FILES += transhuge-stress
TEST_GEN_FILES += userfaultfd TEST_GEN_FILES += userfaultfd
TEST_GEN_FILES += khugepaged
ifeq ($(ARCH),x86_64) ifeq ($(ARCH),x86_64)
CAN_BUILD_I386 := $(shell ./../x86/check_cc.sh $(CC) ../x86/trivial_32bit_program.c -m32) CAN_BUILD_I386 := $(shell ./../x86/check_cc.sh $(CC) ../x86/trivial_32bit_program.c -m32)
...@@ -80,7 +80,7 @@ TEST_FILES := test_vmalloc.sh ...@@ -80,7 +80,7 @@ TEST_FILES := test_vmalloc.sh
KSFT_KHDR_INSTALL := 1 KSFT_KHDR_INSTALL := 1
include ../lib.mk include ../lib.mk
$(OUTPUT)/hmm-tests: LDLIBS += -lhugetlbfs -lpthread $(OUTPUT)/hmm-tests: LDLIBS += -lhugetlbfs
ifeq ($(ARCH),x86_64) ifeq ($(ARCH),x86_64)
BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32)) BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32))
...@@ -131,8 +131,6 @@ warn_32bit_failure: ...@@ -131,8 +131,6 @@ warn_32bit_failure:
endif endif
endif endif
$(OUTPUT)/userfaultfd: LDLIBS += -lpthread
$(OUTPUT)/mlock-random-test: LDLIBS += -lcap $(OUTPUT)/mlock-random-test: LDLIBS += -lcap
$(OUTPUT)/gup_test: ../../../../mm/gup_test.h $(OUTPUT)/gup_test: ../../../../mm/gup_test.h
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include <unistd.h> #include <unistd.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/prctl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include "../../../../mm/gup_test.h" #include "../../../../mm/gup_test.h"
......
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