From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: "Wang, Zhi A" <zhi.a.wang@intel.com>,
Chris Wilson <chris@chris-wilson.co.uk>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v2] drm/i915: Initialise entry in intel_ppat_get() for older compilers
Date: Mon, 20 Nov 2017 11:54:55 +0200 [thread overview]
Message-ID: <1511171695.11899.0.camel@linux.intel.com> (raw)
In-Reply-To: <F3B0350DF4CB6849A642218320DE483D7D67C27D@SHSMSX104.ccr.corp.intel.com>
On Fri, 2017-11-17 at 13:32 +0000, Wang, Zhi A wrote:
> Thanks! Looks good to me.
An explicit Reviewed-by would probably be in place then? Then we get
the patch merged, too.
Regards, Joonas
> -----Original Message-----
> From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
> Sent: Wednesday, November 15, 2017 3:17 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: Chris Wilson <chris@chris-wilson.co.uk>; Joonas Lahtinen <joonas.lahtinen@linux.intel.com>; Wang, Zhi A <zhi.a.wang@intel.com>; Ville Syrjälä <ville.syrjala@linux.intel.com>
> Subject: [PATCH v2] drm/i915: Initialise entry in intel_ppat_get() for older compilers
>
> gcc-4.7.3 is confused by the guards inside intel_ppat_get() and reports:
>
> drivers/gpu/drm/i915/i915_gem_gtt.c: In function ‘intel_ppat_get’:
> drivers/gpu/drm/i915/i915_gem_gtt.c:3044:27: warning: ‘entry’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> Forgive the compiler this once, and rearrange the code so that entry is always initialised.
>
> v2: Flavour with a bit of NULL (instead of ERR_PTR(-ENOSPC).
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Zhi Wang <zhi.a.wang@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem_gtt.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 3c3a699436c9..f92a39fc511c 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -3076,7 +3076,7 @@ const struct intel_ppat_entry * intel_ppat_get(struct drm_i915_private *i915, u8 value) {
> struct intel_ppat *ppat = &i915->ppat;
> - struct intel_ppat_entry *entry;
> + struct intel_ppat_entry *entry = NULL;
> unsigned int scanned, best_score;
> int i;
>
> @@ -3099,7 +3099,7 @@ intel_ppat_get(struct drm_i915_private *i915, u8 value)
> }
>
> if (scanned == ppat->max_entries) {
> - if (!best_score)
> + if (!entry)
> return ERR_PTR(-ENOSPC);
>
> kref_get(&entry->ref);
> --
> 2.15.0
>
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-11-20 9:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-15 10:50 Trivial compiler squelching Chris Wilson
2017-11-15 10:50 ` [PATCH 1/3] drm/i915: Initialise entry in intel_ppat_get() for older compilers Chris Wilson
2017-11-15 12:50 ` Ville Syrjälä
2017-11-15 13:17 ` [PATCH v2] " Chris Wilson
2017-11-15 13:24 ` Ville Syrjälä
2017-11-17 13:32 ` Wang, Zhi A
2017-11-20 9:54 ` Joonas Lahtinen [this message]
2017-11-20 10:02 ` Wang, Zhi A
2017-11-15 10:50 ` [PATCH 2/3] drm/i915/: Initialise trans_min for skl_compute_transition_wm() Chris Wilson
2017-11-15 10:54 ` Chris Wilson
2017-11-16 1:12 ` Rodrigo Vivi
2018-01-22 19:13 ` Chris Wilson
2018-02-19 20:41 ` Chris Wilson
2017-11-15 10:50 ` [PATCH 3/3] drm/i915/crt: Silence compiler warning for uninitialised status Chris Wilson
2017-11-15 12:48 ` Ville Syrjälä
2017-11-15 11:14 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: Initialise entry in intel_ppat_get() for older compilers Patchwork
2017-11-15 12:08 ` ✓ Fi.CI.IGT: " Patchwork
2017-11-15 13:34 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Initialise entry in intel_ppat_get() for older compilers (rev2) Patchwork
2017-11-15 14:27 ` ✓ 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=1511171695.11899.0.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=zhi.a.wang@intel.com \
/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