linux/tools/testing/selftests/vm
Guo Zhengkui 1bf0831383 userfaultfd/selftests: use swap() instead of open coding it
Address the following coccicheck warning:

tools/testing/selftests/vm/userfaultfd.c:1536:21-22: WARNING opportunity
for swap().
tools/testing/selftests/vm/userfaultfd.c:1540:33-34: WARNING opportunity
for swap().

by using swap() for the swapping of variable values and drop
`tmp_area` that is not needed any more.

`swap()` macro in userfaultfd.c is introduced in commit 681696862b
("selftests: vm: remove dependecy from internal kernel macros")

It has been tested with gcc (Debian 8.3.0-6) 8.3.0.

Link: https://lkml.kernel.org/r/20220407123141.4998-1-guozhengkui@vivo.com
Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-05-13 07:20:12 -07:00
..
.gitignore selftests: vm: add test for Soft-Dirty PTE bit 2022-04-28 23:16:11 -07:00
charge_reserved_hugetlb.sh selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting 2022-01-15 16:30:30 +02:00
check_config.sh selftests/vm: hmm-tests: remove the libhugetlbfs dependency 2020-12-15 12:13:38 -08:00
compaction_test.c selftests/vm: 8x compaction_test speedup 2020-10-13 18:38:34 -07:00
config selftests: vm: add test for Soft-Dirty PTE bit 2022-04-28 23:16:11 -07:00
gup_test.c selftests: clarify common error when running gup_test 2022-05-09 18:20:47 -07:00
hmm-tests.c mm/hmm.c: allow VM_MIXEDMAP to work with hmm_range_fault 2022-01-15 16:30:31 +02:00
hugepage-mmap.c
hugepage-mremap.c selftest/vm: test that mremap fails on non-existent vma 2022-05-13 07:20:07 -07:00
hugepage-shm.c
hugepage-vmemmap.c selftests: vm: add a hugetlb test case 2022-03-22 15:57:08 -07:00
hugetlb_reparenting_test.sh selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting 2022-01-15 16:30:30 +02:00
hugetlb-madvise.c selftests/vm: add hugetlb madvise MADV_DONTNEED MADV_REMOVE test 2022-03-24 19:06:50 -07:00
khugepaged.c khugepaged: selftests: remove debug_cow 2021-06-30 20:47:26 -07:00
ksm_tests.c selftest/vm: add util.h and and move helper functions there 2022-03-24 19:06:45 -07:00
madv_populate.c selftests: vm: bring common functions to a new file 2022-04-28 23:16:11 -07:00
Makefile selftests: vm: add test for Soft-Dirty PTE bit 2022-04-28 23:16:11 -07:00
map_fixed_noreplace.c selftest/vm: fix map_fixed_noreplace test failure 2022-02-26 09:51:17 -08:00
map_hugetlb.c selftests/vm: fix display of page size in map_hugetlb 2020-09-19 13:13:39 -07:00
map_populate.c
memfd_secret.c selftests: kselftest framework: provide "finished" helper 2022-03-24 19:06:51 -07:00
migration.c mm: add selftests for migration entries 2022-04-28 23:16:07 -07:00
mlock2-tests.c
mlock2.h
mlock-random-test.c selftests: Fix spelling mistake "cann't" -> "cannot" 2021-09-03 09:58:13 -07:00
mremap_dontunmap.c selftests: add a MREMAP_DONTUNMAP selftest for shmem 2021-04-30 11:20:39 -07:00
mremap_test.c selftest/vm: support xfail in mremap_test 2022-04-21 20:01:10 -07:00
on-fault-limit.c
pkey-helpers.h selftests/vm: remove ARRAY_SIZE define from individual tests 2021-12-10 17:51:25 -07:00
pkey-powerpc.h selftests: vm: pkeys: use the correct page size on powerpc 2020-06-04 19:06:27 -07:00
pkey-x86.h selftests/vm/pkeys: exercise x86 XSAVE init state 2021-07-01 11:06:06 -07:00
protection_keys.c selftests/vm/pkeys: exercise x86 XSAVE init state 2021-07-01 11:06:06 -07:00
run_vmtests.sh selftests: vm: fix shellcheck warnings in run_vmtests.sh 2022-04-28 23:16:11 -07:00
soft-dirty.c selftests: vm: add test for Soft-Dirty PTE bit 2022-04-28 23:16:11 -07:00
split_huge_page_test.c selftests: vm: bring common functions to a new file 2022-04-28 23:16:11 -07:00
test_hmm.sh
test_vmalloc.sh vm/test_vmalloc.sh: adapt for updated driver interface 2021-04-30 11:20:40 -07:00
thuge-gen.c
transhuge-stress.c selftest/vm: add util.h and and move helper functions there 2022-03-24 19:06:45 -07:00
userfaultfd.c userfaultfd/selftests: use swap() instead of open coding it 2022-05-13 07:20:12 -07:00
util.h selftest/vm: add helpers to detect PAGE_SIZE and PAGE_SHIFT 2022-03-24 19:06:45 -07:00
va_128TBswitch.c selftests/vm: remove ARRAY_SIZE define from individual tests 2021-12-10 17:51:25 -07:00
virtual_address_range.c
vm_util.c selftests: vm: bring common functions to a new file 2022-04-28 23:16:11 -07:00
vm_util.h selftests: vm: bring common functions to a new file 2022-04-28 23:16:11 -07:00
write_hugetlb_memory.sh selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting 2022-01-15 16:30:30 +02:00
write_to_hugetlbfs.c