The patch titled Subject: tools/testing/selftests/vm/userfaultfd.c: use swap() to make code cleaner has been added to the -mm tree. Its filename is selftests-vm-use-swap-to-make-code-cleaner.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/selftests-vm-use-swap-to-make-code-cleaner.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/selftests-vm-use-swap-to-make-code-cleaner.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: chiminghao <chi.minghao@xxxxxxxxxx> Subject: tools/testing/selftests/vm/userfaultfd.c: use swap() to make code cleaner Fix the following coccicheck REVIEW: ./tools/testing/selftests/vm/userfaultfd.c:1531:21-22:use swap() to make code cleaner Link: https://lkml.kernel.org/r/20211124031632.35317-1-chi.minghao@xxxxxxxxxx Signed-off-by: chiminghao <chi.minghao@xxxxxxxxxx> Reported-by: Zeal Robot <zealci@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- tools/testing/selftests/vm/userfaultfd.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) --- a/tools/testing/selftests/vm/userfaultfd.c~selftests-vm-use-swap-to-make-code-cleaner +++ a/tools/testing/selftests/vm/userfaultfd.c @@ -1413,7 +1413,6 @@ static void userfaultfd_pagemap_test(uns static int userfaultfd_stress(void) { void *area; - char *tmp_area; unsigned long nr; struct uffdio_register uffdio_register; struct uffd_stats uffd_stats[nr_cpus]; @@ -1524,13 +1523,9 @@ static int userfaultfd_stress(void) count_verify[nr], nr); /* prepare next bounce */ - tmp_area = area_src; - area_src = area_dst; - area_dst = tmp_area; - - tmp_area = area_src_alias; - area_src_alias = area_dst_alias; - area_dst_alias = tmp_area; + swap(area_src, area_dst); + + swap(area_src_alias, area_dst_alias); uffd_stats_report(uffd_stats, nr_cpus); } _ Patches currently in -mm which might be from chi.minghao@xxxxxxxxxx are selftests-vm-use-swap-to-make-code-cleaner.patch