[PATCH 2/7] tegra: add break to switch statements

Lucas Stach l.stach at pengutronix.de
Mon Feb 17 07:55:10 EST 2014


Am Montag, den 17.02.2014, 07:53 +0100 schrieb Sascha Hauer:
> On Thu, Feb 13, 2014 at 11:32:46PM +0100, Lucas Stach wrote:
> > Avoids a possible miscompilation.
> > 
> > Signed-off-by: Lucas Stach <dev at lynxeye.de>
> > ---
> >  arch/arm/mach-tegra/include/mach/lowlevel.h | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/arch/arm/mach-tegra/include/mach/lowlevel.h b/arch/arm/mach-tegra/include/mach/lowlevel.h
> > index 472348a..9081b1c 100644
> > --- a/arch/arm/mach-tegra/include/mach/lowlevel.h
> > +++ b/arch/arm/mach-tegra/include/mach/lowlevel.h
> > @@ -73,8 +73,10 @@ enum tegra_chiptype tegra_get_chiptype(void)
> >  	switch ((hidrev & HIDREV_CHIPID_MASK) >> HIDREV_CHIPID_SHIFT) {
> >  	case 0x20:
> >  		return TEGRA20;
> > +		break;
> >  	default:
> >  		return TEGRA_UNK_REV;
> > +		break;
> 
> What kind of miscompilation other than a compiler bug are you thinking
> of? Have you seen that this patch changes anything?
> 

I have to admit that I haven't investigated the issue closely, but this
actually makes the difference between working and nonworking when adding
in the Tegra3 case later on.

-- 
Pengutronix e.K.                           | Lucas Stach                 |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5076 |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list