Re: [PATCH] drm/i915: Avoid compiler warning for maybe unused gu_misc_iir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Mika Kuoppala (2018-09-26 12:06:41)
> Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> writes:
> 
> > /kisskb/src/drivers/gpu/drm/i915/i915_irq.c: warning: 'gu_misc_iir' may be used uninitialized in this function [-Wuninitialized]:  => 3120:10
> >
> > Silence the compiler warning by ensuring that the local variable is
> > initialised and removing the guard that is confusing the older gcc.
> >
> > Reported-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> > Fixes: df0d28c185ad ("drm/i915/icl: GSE interrupt moves from DE_MISC to GU_MISC")
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx>
> > Cc: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/i915_irq.c | 33 ++++++++++++---------------------
> >  1 file changed, 12 insertions(+), 21 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> > index 10f28a2ee2e6..2e242270e270 100644
> > --- a/drivers/gpu/drm/i915/i915_irq.c
> > +++ b/drivers/gpu/drm/i915/i915_irq.c
> > @@ -3088,36 +3088,27 @@ gen11_gt_irq_handler(struct drm_i915_private * const i915,
> >       spin_unlock(&i915->irq_lock);
> >  }
> >  
> > -static void
> > -gen11_gu_misc_irq_ack(struct drm_i915_private *dev_priv, const u32 master_ctl,
> > -                   u32 *iir)
> > +static u32
> > +gen11_gu_misc_irq_ack(struct drm_i915_private *dev_priv, const u32 master_ctl)
> >  {
> >       void __iomem * const regs = dev_priv->regs;
> > +     u32 iir;
> >  
> >       if (!(master_ctl & GEN11_GU_MISC_IRQ))
> > -             return;
> > +             return 0;
> > +
> > +     iir = raw_reg_read(regs, GEN11_GU_MISC_IIR);
> > +     if (likely(iir))
> > +             raw_reg_write(regs, GEN11_GU_MISC_IIR, iir);
> >  
> > -     *iir = raw_reg_read(regs, GEN11_GU_MISC_IIR);
> > -     if (likely(*iir))
> > -             raw_reg_write(regs, GEN11_GU_MISC_IIR, *iir);
> > +     return iir;
> >  }
> >  
> >  static void
> > -gen11_gu_misc_irq_handler(struct drm_i915_private *dev_priv,
> > -                       const u32 master_ctl, const u32 iir)
> > +gen11_gu_misc_irq_handler(struct drm_i915_private *dev_priv, const u32 iir)
> >  {
> > -     if (!(master_ctl & GEN11_GU_MISC_IRQ))
> > -             return;
> > -
> > -     if (unlikely(!iir)) {
> > -             DRM_ERROR("GU_MISC iir blank!\n");
> > -             return;
> > -     }
> > -
> >       if (iir & GEN11_GU_MISC_GSE)
> >               intel_opregion_asle_intr(dev_priv);
> > -     else
> > -             DRM_ERROR("Unexpected GU_MISC interrupt 0x%x\n", iir);
> 
> I see you are not fan of asserting irq behaviour in this
> level.

:) Indeed, especially if we get here we requested the bit. If we didn't,
there's not much we can do and nothing we can fix.

And pushed, thanks for the review.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux