[Intel-gfx] [PATCH] drm/i915/ddi: Silence compiler warning for unknown output type

Chris Wilson chris at chris-wilson.co.uk
Mon Apr 4 07:25:08 UTC 2016


On Mon, Apr 04, 2016 at 09:20:27AM +0300, Joonas Lahtinen wrote:
> On su, 2016-04-03 at 21:59 +0100, Chris Wilson wrote:
> > Silences
> > 
> > 	src/drivers/gpu/drm/i915/intel_ddi.c: warning: 'port' may be used uninitialized in this function [-Wuninitialized]
> > 
> > Reported-by: Geert Uytterhoeven <geert at linux-m68k.org>
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > ---
> >  drivers/gpu/drm/i915/intel_ddi.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> > index 766156f88ef4..921edf183d22 100644
> > --- a/drivers/gpu/drm/i915/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/intel_ddi.c
> > @@ -315,6 +315,9 @@ static void ddi_get_encoder_port(struct intel_encoder *intel_encoder,
> >  		*dig_port = enc_to_mst(encoder)->primary;
> >  		*port = (*dig_port)->port;
> >  		break;
> > +	default:
> > +		WARN(1, "Invalid DDI encoder type %d\n", intel_encoder->type);
> > +		/* fallthrough and treat as unknown */
> 
> While touching it, might as well fix into MISSING_CASE. With that;

I was tempted, I wasn't sure if not using MISSING_CASE was deliberate
(trying not to confuse semantics between adding support for a new
generation versus an unknown DDI)? So I left it for whoever has to make
that fix (and kept the change as small as possible for a minor buglet).
 
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Thanks,
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list