Skip to content

Commit

Permalink
tools/testing/selftests/vm/userfaultfd.c: use swap() to make code cle…
Browse files Browse the repository at this point in the history
…aner

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@zte.com.cn
Signed-off-by: chiminghao <chi.minghao@zte.com.cn>
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
chiminghao authored and Linus Torvalds committed Jan 15, 2022
1 parent 4e5aa1f commit 2c769ed
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tools/testing/selftests/vm/userfaultfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,6 @@ static void userfaultfd_pagemap_test(unsigned int test_pgsize)
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];
Expand Down Expand Up @@ -1528,13 +1527,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;
swap(area_src, area_dst);

tmp_area = area_src_alias;
area_src_alias = area_dst_alias;
area_dst_alias = tmp_area;
swap(area_src_alias, area_dst_alias);

uffd_stats_report(uffd_stats, nr_cpus);
}
Expand Down

0 comments on commit 2c769ed

Please sign in to comment.