diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-10-14 14:23:51 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-10-14 14:23:51 -0700 |
commit | 9e51183e9462852ad8d1f3b6c687500b770605f4 (patch) | |
tree | e8e3b2257bea087b827590624a4040f8d57f300f /tools/testing/selftests/vm/gup_benchmark.c | |
parent | Merge tag 'xfs-5.10-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux (diff) | |
parent | tools: Avoid comma separated statements (diff) | |
download | wireguard-linux-9e51183e9462852ad8d1f3b6c687500b770605f4.tar.xz wireguard-linux-9e51183e9462852ad8d1f3b6c687500b770605f4.zip |
Merge tag 'linux-kselftest-fixes-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull kselftest updates from Shuah Khan:
- a selftests harness fix to flush stdout before forking to avoid
parent and child printing duplicates messages. This is evident when
test output is redirected to a file.
- a tools/ wide change to avoid comma separated statements from Joe
Perches. This fix spans tools/lib, tools/power/cpupower, and
selftests.
* tag 'linux-kselftest-fixes-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
tools: Avoid comma separated statements
selftests/harness: Flush stdout before forking
Diffstat (limited to 'tools/testing/selftests/vm/gup_benchmark.c')
-rw-r--r-- | tools/testing/selftests/vm/gup_benchmark.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/testing/selftests/vm/gup_benchmark.c b/tools/testing/selftests/vm/gup_benchmark.c index 31f8bb086907..1d4359341e44 100644 --- a/tools/testing/selftests/vm/gup_benchmark.c +++ b/tools/testing/selftests/vm/gup_benchmark.c @@ -105,12 +105,16 @@ int main(int argc, char **argv) gup.flags |= FOLL_WRITE; fd = open("/sys/kernel/debug/gup_benchmark", O_RDWR); - if (fd == -1) - perror("open"), exit(1); + if (fd == -1) { + perror("open"); + exit(1); + } p = mmap(NULL, size, PROT_READ | PROT_WRITE, flags, filed, 0); - if (p == MAP_FAILED) - perror("mmap"), exit(1); + if (p == MAP_FAILED) { + perror("mmap"); + exit(1); + } gup.addr = (unsigned long)p; if (thp == 1) @@ -123,8 +127,10 @@ int main(int argc, char **argv) for (i = 0; i < repeats; i++) { gup.size = size; - if (ioctl(fd, cmd, &gup)) - perror("ioctl"), exit(1); + if (ioctl(fd, cmd, &gup)) { + perror("ioctl"); + exit(1); + } printf("Time: get:%lld put:%lld us", gup.get_delta_usec, gup.put_delta_usec); |