public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ser, Simon" <simon.ser@intel.com>
To: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"chris@chris-wilson.co.uk" <chris@chris-wilson.co.uk>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] benchmarks: Use labs() for abs(long)
Date: Wed, 28 Aug 2019 07:35:14 +0000	[thread overview]
Message-ID: <60bd30c0794cbed3def009f789b2289faddf23c7.camel@intel.com> (raw)
In-Reply-To: <20190827161417.3330-1-chris@chris-wilson.co.uk>

On Tue, 2019-08-27 at 17:14 +0100, Chris Wilson wrote:
> 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>

> ---
>  benchmarks/gem_syslatency.c | 2 +-
>  benchmarks/gem_wsim.c       | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/benchmarks/gem_syslatency.c b/benchmarks/gem_syslatency.c
> index 7671dc43e..d7cf0ed49 100644
> --- a/benchmarks/gem_syslatency.c
> +++ b/benchmarks/gem_syslatency.c
> @@ -343,7 +343,7 @@ static unsigned long calibrate_nop(unsigned int target_us,
>  		sz = loops * sz / elapsed(&t_start, &t_end) * 1e3 * target_us;
>  		sz = ALIGN(sz, sizeof(uint32_t));
>  	} while (elapsed(&t_0, &t_end) < 5 ||
> -		 abs(sz - prev) > (sz * tolerance_pct / 100));
> +		 labs(sz - prev) > (sz * tolerance_pct / 100));
>  
>  	close(fd);
>  
> diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
> index a76fdbfe2..b8e22b3f6 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);
>  }
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-08-28  7:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27 16:14 [igt-dev] [PATCH i-g-t] benchmarks: Use labs() for abs(long) Chris Wilson
2019-08-27 17:20 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-08-28  7:35 ` Ser, Simon [this message]
2019-08-29  8:06 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60bd30c0794cbed3def009f789b2289faddf23c7.camel@intel.com \
    --to=simon.ser@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox