From 3f6080996885b997685f08ecb8b416b2dc485290 Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Wed, 12 Feb 2020 19:02:23 +0200 Subject: benchmarks/gem_wsim: Avoid labs(unsigned long) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../benchmarks/gem_wsim.c: In function ‘calibrate_nop’: ../benchmarks/gem_wsim.c:2999:4: warning: taking the absolute value of unsigned type ‘long unsigned int’ has no effect [-Wabsolute-value] 2999 | labs(size - last_size) > (size * tolerance_pct / 100)); Frankly the warning looks like nonsense to me, unless the compiler actually optimizes the labs() away. Otherwise there's going to be an implicit cast to signed long anyway since that's what labs() takes. But the warning is easy enough to avoid here so let's do it. Reviewed-by: Chris Wilson Signed-off-by: Ville Syrjälä --- benchmarks/gem_wsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'benchmarks') diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index 0ef1cf28..aaf3a161 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -2969,7 +2969,7 @@ static unsigned long calibrate_nop(unsigned int tolerance_pct, struct intel_exec .buffers_ptr = (uintptr_t)&obj, .flags = engine->flags }; - unsigned long size, last_size; + long size, last_size; struct timespec t_0, t_end; clock_gettime(CLOCK_MONOTONIC, &t_0); -- cgit v1.2.3