diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-12-03 14:51:16 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-12-08 19:26:39 +0200 |
commit | 8032f526ef1d075e303342b7741db35faadfd00f (patch) | |
tree | 95ddfbf5e2cf7d471e48d8616ca64550400abeac /tests/gem_stress.c | |
parent | e1bdab9973ffdb5477666a384b011fa012965758 (diff) |
tests: Run lib/igt.cocci
Found some open coded min()/max()/swap() macros.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/gem_stress.c')
-rw-r--r-- | tests/gem_stress.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/gem_stress.c b/tests/gem_stress.c index 6e3a64c4..9f20bde2 100644 --- a/tests/gem_stress.c +++ b/tests/gem_stress.c @@ -570,11 +570,8 @@ static void init_set(unsigned set) static void exchange_uint(void *array, unsigned i, unsigned j) { unsigned *i_arr = array; - unsigned i_tmp; - i_tmp = i_arr[i]; - i_arr[i] = i_arr[j]; - i_arr[j] = i_tmp; + swap(i_arr[i], i_arr[j]); } static void copy_tiles(unsigned *permutation) @@ -741,7 +738,7 @@ static void init(void) if (options.num_buffers == 0) { tmp = gem_aperture_size(drm_fd); - tmp = tmp > 256*(1024*1024) ? 256*(1024*1024) : tmp; + tmp = min(256 * (1024 * 1024), tmp); num_buffers = 2 * tmp / options.scratch_buf_size / 3; num_buffers /= 2; igt_info("using %u buffers\n", num_buffers); |