[Intel-gfx] [PATCH i-g-t 14/17] lib/igt_aux: s/swap/igt_swap/

Daniel Vetter daniel.vetter at ffwll.ch
Tue Feb 10 10:05:57 PST 2015


It collides with the subtest naming convention glossary entry for swap.
Which makes the docbook xml stuff unhappy.

Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 lib/igt.cocci           | 4 ++--
 lib/igt_aux.h           | 2 +-
 tests/eviction_common.c | 2 +-
 tests/gem_ctx_thrash.c  | 4 ++--
 tests/gem_seqno_wrap.c  | 2 +-
 tests/gem_stress.c      | 2 +-
 tests/kms_flip.c        | 4 ++--
 7 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/igt.cocci b/lib/igt.cocci
index fd4ad2564bea..41a8beb36029 100644
--- a/lib/igt.cocci
+++ b/lib/igt.cocci
@@ -92,7 +92,7 @@ expression E;
 - assert(E);
 + igt_assert(E);
 
-// Replace open-coded swap()
+// Replace open-coded igt_swap()
 @@
 type T;
 T a, b, tmp;
@@ -100,7 +100,7 @@ T a, b, tmp;
 - tmp = a;
 - a = b;
 - b = tmp;
-+ swap(a, b);
++ igt_swap(a, b);
 
 // Replace open-coded min()
 @@
diff --git a/lib/igt_aux.h b/lib/igt_aux.h
index 798a5b45fcb9..edc36a221922 100644
--- a/lib/igt_aux.h
+++ b/lib/igt_aux.h
@@ -94,7 +94,7 @@ void intel_require_memory(uint32_t count, uint32_t size, unsigned mode);
 #define min(a, b) ((a) < (b) ? (a) : (b))
 #define max(a, b) ((a) > (b) ? (a) : (b))
 
-#define swap(a, b) do {		\
+#define igt_swap(a, b) do {	\
 	typeof(a) _tmp = (a);	\
 	(a) = (b);		\
 	(b) = _tmp;		\
diff --git a/tests/eviction_common.c b/tests/eviction_common.c
index 4a12dcbc345d..b18c2a73f9c7 100644
--- a/tests/eviction_common.c
+++ b/tests/eviction_common.c
@@ -55,7 +55,7 @@ static void exchange_uint32_t(void *array, unsigned i, unsigned j)
 {
 	uint32_t *i_arr = array;
 
-	swap(i_arr[i], i_arr[j]);
+	igt_swap(i_arr[i], i_arr[j]);
 }
 
 static int minor_evictions(int fd, struct igt_eviction_test_ops *ops,
diff --git a/tests/gem_ctx_thrash.c b/tests/gem_ctx_thrash.c
index 5c272338e795..b4818f4e6337 100644
--- a/tests/gem_ctx_thrash.c
+++ b/tests/gem_ctx_thrash.c
@@ -55,13 +55,13 @@ static int ctx_per_thread;
 static void xchg_ptr(void *array, unsigned i, unsigned j)
 {
 	void **A = array;
-	swap(A[i], A[j]);
+	igt_swap(A[i], A[j]);
 }
 
 static void xchg_int(void *array, unsigned i, unsigned j)
 {
 	int *A = array;
-	swap(A[i], A[j]);
+	igt_swap(A[i], A[j]);
 }
 
 static int reopen(int _fd)
diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c
index 42493efdb20e..d07ec96064eb 100644
--- a/tests/gem_seqno_wrap.c
+++ b/tests/gem_seqno_wrap.c
@@ -172,7 +172,7 @@ static void exchange_uint(void *array, unsigned i, unsigned j)
 {
 	unsigned *i_arr = array;
 
-	swap(i_arr[i], i_arr[j]);
+	igt_swap(i_arr[i], i_arr[j]);
 }
 
 static void run_sync_test(int num_buffers, bool verify)
diff --git a/tests/gem_stress.c b/tests/gem_stress.c
index 9f20bde2f45a..f687b2d1c795 100644
--- a/tests/gem_stress.c
+++ b/tests/gem_stress.c
@@ -571,7 +571,7 @@ static void exchange_uint(void *array, unsigned i, unsigned j)
 {
 	unsigned *i_arr = array;
 
-	swap(i_arr[i], i_arr[j]);
+	igt_swap(i_arr[i], i_arr[j]);
 }
 
 static void copy_tiles(unsigned *permutation)
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 292b7bc60f09..09dc3c794fdf 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -242,7 +242,7 @@ static int _emit_dummy_load__bcs(struct test_output *o, int limit, int timeout)
 			  2048, 2048,
 			  2048*4, 2048*4);
 
-		swap(src_bo, dst_bo);
+		igt_swap(src_bo, dst_bo);
 	}
 	blit_copy(fb_bo, src_bo,
 		  min(o->fb_width, 2048), min(o->fb_height, 2048),
@@ -357,7 +357,7 @@ static int _emit_dummy_load__rcs(struct test_output *o, int limit, int timeout)
 			 2048, 2048,
 			 dst, 0, 0);
 
-		swap(src, dst);
+		igt_swap(src, dst);
 	}
 	copyfunc(batch, NULL,
 		 src, 0, 0,
-- 
2.1.4



More information about the Intel-gfx mailing list