diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-02-12 19:02:23 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-02-14 15:24:09 +0200 |
commit | 3f6080996885b997685f08ecb8b416b2dc485290 (patch) | |
tree | c1f88295113ed890fb51b73f03da5230c752ee56 /benchmarks | |
parent | 534ca091fe4ffed916752165bc5becd7ff56cd84 (diff) |
benchmarks/gem_wsim: Avoid labs(unsigned long)
../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 <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'benchmarks')
-rw-r--r-- | benchmarks/gem_wsim.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |