Commit 34b46efd authored by Changcheng Deng's avatar Changcheng Deng Committed by Linus Torvalds
Browse files

lib/test_vmalloc.c: use swap() to make code cleaner

parent c00b6b96
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -393,7 +393,7 @@ static struct test_driver {
static void shuffle_array(int *arr, int n)
{
	unsigned int rnd;
	int i, j, x;
	int i, j;

	for (i = n - 1; i > 0; i--)  {
		get_random_bytes(&rnd, sizeof(rnd));
@@ -402,9 +402,7 @@ static void shuffle_array(int *arr, int n)
		j = rnd % i;

		/* Swap indexes. */
		x = arr[i];
		arr[i] = arr[j];
		arr[j] = x;
		swap(arr[i], arr[j]);
	}
}