[Intel-gfx] [PATCH] drm/i915: Initialise subslice prior to potential zero-length loop
Summers, Stuart
stuart.summers at intel.com
Tue Jun 4 20:59:39 UTC 2019
On Tue, 2019-06-04 at 11:49 +0300, Lionel Landwerlin wrote:
> On 29/05/2019 14:24, Chris Wilson wrote:
> > Appease static analysers by making sure subslice always have a
> > value.
> >
> > drivers/gpu/drm/i915//gt/intel_engine_cs.c:971
> > intel_sseu_fls_subslice() error: uninitialized symbol 'subslice'.
> >
> > There's also the nagging question of whether that fls() is off-by-
> > one...
> >
> >
> > Fixes: 1ac159e23c2c ("drm/i915: Expand subslice mask")
Thanks for the patch! Given the above was reverted, I can incorporate
this in to the updates I push. I'll make sure to include you on that
review.
Thanks,
Stuart
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
> > Cc: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> > Cc: Stuart Summers <stuart.summers at intel.com>
> > Cc: Manasi Navare <manasi.d.navare at intel.com>
>
>
> Stuart should probably rb this too as he's been looking after this
> topology stuff.
>
> Looks good to me :
>
>
> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
>
>
> > ---
> > drivers/gpu/drm/i915/gt/intel_engine_cs.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> > b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> > index 158722b50691..fc880424be2f 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> > @@ -956,12 +956,12 @@ const char *i915_cache_level_str(struct
> > drm_i915_private *i915, int type)
> > static inline u32
> > intel_sseu_fls_subslice(const struct sseu_dev_info *sseu, u32
> > slice)
> > {
> > - u32 subslice;
> > + const u8 *subslice_mask = sseu->subslice_mask + slice * sseu-
> > >ss_stride;
> > + u32 subslice = 0;
> > int i;
> >
> > for (i = sseu->ss_stride - 1; i >= 0; i--) {
> > - subslice = fls(sseu->subslice_mask[slice * sseu-
> > >ss_stride +
> > - i]);
> > + subslice = fls(subslice_mask[i]);
> > if (subslice) {
> > subslice += i * BITS_PER_BYTE;
> > break;
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3270 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20190604/356abfe7/attachment.bin>
More information about the Intel-gfx
mailing list