summaryrefslogtreecommitdiff
path: root/benchmarks/gem_wsim.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-08-27 17:13:25 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-08-28 08:50:38 +0100
commita562ad36d1a7efa3053688429792ce97f188d758 (patch)
tree59921c9fb6441514d69fd70d182544cecf7e6089 /benchmarks/gem_wsim.c
parenta4e8217bcdfef9bb523f26a9084bbf615a6e8abb (diff)
benchmarks: Use labs() for abs(long)
e.g. benchmarks/gem_wsim.c:2936:4: warning: absolute value function ‘abs’ given an argument of type ‘long int’ but has parameter of type ‘int’ which may cause truncation of value [-Wabsolute-value] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Simon Ser <simon.ser@intel.com>
Diffstat (limited to 'benchmarks/gem_wsim.c')
-rw-r--r--benchmarks/gem_wsim.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index a76fdbfe..b8e22b3f 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -2933,7 +2933,7 @@ static unsigned long calibrate_nop(unsigned int tolerance_pct)
size = loops * size / elapsed(&t_start, &t_end) / 1e6 * usecs;
size = ALIGN(size, sizeof(uint32_t));
} while (elapsed(&t_0, &t_end) < 5 ||
- abs(size - last_size) > (size * tolerance_pct / 100));
+ labs(size - last_size) > (size * tolerance_pct / 100));
return size / sizeof(uint32_t);
}