diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-28 21:27:13 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-28 21:27:13 -0800 |
commit | 903b77c631673eeec9e9114e9524171cdf9a2646 (patch) | |
tree | 030064e334b9adc8328b9410bc2ffb2f52548a68 /tools/testing/selftests/drivers | |
parent | 457fa3469a65a524be04412f5cd497fa3b11c9fd (diff) | |
parent | 283ac6d5fb2a47f12bcef7806b78acf6ad89907e (diff) | |
download | linux-903b77c631673eeec9e9114e9524171cdf9a2646.tar.bz2 |
Merge tag 'linux-kselftest-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull Kselftest updates from Shuah Khan:
- fixes and improvements to the framework, and individual tests
- a new media test for IR encoders from Sean Young
- a new watchdog test option to find time left on a timer
* tag 'linux-kselftest-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
selftests: Fix test errors related to lib.mk khdr target
fix dma-buf/udmabuf selftest
selftests: watchdog: fix spelling mistake "experies" -> "expires"
selftests: watchdog: Add gettimeleft command line arg
selftests: do not macro-expand failed assertion expressions
selftests/ftrace: Fix invalid SPDX identifiers
selftests: gpio: Find libmount with pkg-config if available
selftests: firmware: add CONFIG_FW_LOADER_USER_HELPER_FALLBACK to config
selftests: firmware: remove use of non-standard diff -Z option
media: rc: self test for IR encoders and decoders
Diffstat (limited to 'tools/testing/selftests/drivers')
-rw-r--r-- | tools/testing/selftests/drivers/dma-buf/Makefile | 2 | ||||
-rw-r--r-- | tools/testing/selftests/drivers/dma-buf/udmabuf.c | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/tools/testing/selftests/drivers/dma-buf/Makefile b/tools/testing/selftests/drivers/dma-buf/Makefile index 4154c3d7aa58..f22c3f7cf612 100644 --- a/tools/testing/selftests/drivers/dma-buf/Makefile +++ b/tools/testing/selftests/drivers/dma-buf/Makefile @@ -2,4 +2,6 @@ CFLAGS += -I../../../../../usr/include/ TEST_GEN_PROGS := udmabuf +top_srcdir ?=../../../../.. + include ../../lib.mk diff --git a/tools/testing/selftests/drivers/dma-buf/udmabuf.c b/tools/testing/selftests/drivers/dma-buf/udmabuf.c index 376b1d6730bd..4de902ea14d8 100644 --- a/tools/testing/selftests/drivers/dma-buf/udmabuf.c +++ b/tools/testing/selftests/drivers/dma-buf/udmabuf.c @@ -4,7 +4,7 @@ #include <unistd.h> #include <string.h> #include <errno.h> -#include <fcntl.h> +#include <linux/fcntl.h> #include <malloc.h> #include <sys/ioctl.h> @@ -33,12 +33,19 @@ int main(int argc, char *argv[]) exit(77); } - memfd = memfd_create("udmabuf-test", MFD_CLOEXEC); + memfd = memfd_create("udmabuf-test", MFD_ALLOW_SEALING); if (memfd < 0) { printf("%s: [skip,no-memfd]\n", TEST_PREFIX); exit(77); } + ret = fcntl(memfd, F_ADD_SEALS, F_SEAL_SHRINK); + if (ret < 0) { + printf("%s: [skip,fcntl-add-seals]\n", TEST_PREFIX); + exit(77); + } + + size = getpagesize() * NUM_PAGES; ret = ftruncate(memfd, size); if (ret == -1) { |