[Intel-gfx] [PATCH 04/10] drm/i915: Add "missing" break to haswell_get_ddi_pll()

Ville Syrjälä ville.syrjala at linux.intel.com
Tue Dec 1 11:45:44 PST 2015


On Tue, Dec 01, 2015 at 05:34:40PM -0200, Paulo Zanoni wrote:
> 2015-12-01 11:08 GMT-02:00  <ville.syrjala at linux.intel.com>:
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> >
> > While not techically needed on the last case in the switch statement,
> 
> "techically"
> 
> > the 'break' makes it look better IMO.
> 
> Just out of curiosity: what's your opinion on the lack of a "break" at
> the default case, such as the one we have in bxt_get_ddi_pll()?

I think I tend to include the break in all cases, except when I want
an explicit fall through, at which point I'd usually put a comment in
its place to tell people that I really meant it.

If on the hand there's a 'return' involved, I leave out the break
since it's dead anyway.

But I suspect I fail to follow even my own rules sometimes.

> 
> Reviewed-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
> 
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 29ea4c458ab3..d049b087e8e6 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -9808,6 +9808,7 @@ static void haswell_get_ddi_pll(struct drm_i915_private *dev_priv,
> >                 break;
> >         case PORT_CLK_SEL_SPLL:
> >                 pipe_config->shared_dpll = DPLL_ID_SPLL;
> > +               break;
> >         }
> >  }
> >
> > --
> > 2.4.10
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> 
> 
> -- 
> Paulo Zanoni

-- 
Ville Syrjälä
Intel OTC


More information about the Intel-gfx mailing list