diff options
-rw-r--r-- | lib/igt.cocci | 4 | ||||
-rw-r--r-- | lib/igt_aux.h | 2 | ||||
-rw-r--r-- | tests/eviction_common.c | 2 | ||||
-rw-r--r-- | tests/gem_ctx_thrash.c | 4 | ||||
-rw-r--r-- | tests/gem_seqno_wrap.c | 2 | ||||
-rw-r--r-- | tests/gem_stress.c | 2 | ||||
-rw-r--r-- | tests/kms_flip.c | 4 |
7 files changed, 10 insertions, 10 deletions
diff --git a/lib/igt.cocci b/lib/igt.cocci index fd4ad2564..41a8beb36 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 798a5b45f..edc36a221 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 4a12dcbc3..b18c2a73f 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 5c272338e..b4818f4e6 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 42493efdb..d07ec9606 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 9f20bde2f..f687b2d1c 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 292b7bc60..09dc3c794 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, |