Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/selftests: Initialise request to silence a compiler
Date: Thu, 14 Jun 2018 16:10:13 +0300	[thread overview]
Message-ID: <20180614131013.GE20518@intel.com> (raw)
In-Reply-To: <20180614124923.18071-1-chris@chris-wilson.co.uk>

On Thu, Jun 14, 2018 at 01:49:23PM +0100, Chris Wilson wrote:
> With an old (4.7.3 on 32bit) gcc, it emits a warning for
> 
> In file included from drivers/gpu/drm/i915/i915_request.c:1425:0:
> drivers/gpu/drm/i915/selftests/i915_request.c: In function ‘live_nop_request’:
> drivers/gpu/drm/i915/selftests/i915_request.c:380:21: error: ‘request’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
> 
> Silence it by just setting it to NULL on initialisation.

Looks harmeless

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/selftests/i915_request.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c
> index f5d00332bb31..63cd9486cc13 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_request.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_request.c
> @@ -342,9 +342,9 @@ static int live_nop_request(void *arg)
>  	mutex_lock(&i915->drm.struct_mutex);
>  
>  	for_each_engine(engine, i915, id) {
> -		IGT_TIMEOUT(end_time);
> -		struct i915_request *request;
> +		struct i915_request *request = NULL;
>  		unsigned long n, prime;
> +		IGT_TIMEOUT(end_time);
>  		ktime_t times[2] = {};
>  
>  		err = begin_live_test(&t, i915, __func__, engine->name);
> -- 
> 2.17.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-06-14 13:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14 12:49 [PATCH] drm/i915/selftests: Initialise request to silence a compiler Chris Wilson
2018-06-14 13:10 ` Ville Syrjälä [this message]
2018-06-14 13:55 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-06-14 16:58 ` ✓ 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=20180614131013.GE20518@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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