[U-Boot] [PATCH 02/12] spl: mmc: add break statements in spl_mmc_load_image()

Nikita Kiryanov nikita at compulab.co.il
Thu Oct 22 15:53:12 CEST 2015


Hi,

On Thu, Oct 22, 2015 at 03:23:21PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 22-10-15 15:08, Nikita Kiryanov wrote:
> >On Thu, Oct 22, 2015 at 02:37:11PM +0200, Hans de Goede wrote:
> >>Hi,
> >>
> >>On 22-10-15 14:01, Nikita Kiryanov wrote:
> >>>  		if (!err)
> >>>  			return;
> >>>  #endif
> >>>+		break;
> >>>  #endif
> >>>  	case MMCSD_MODE_UNDEFINED:
> >>>  	default:
> >>>  #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
> >>>-		if (err)
> >>>-			puts("spl: mmc: no boot mode left to try\n");
> >>>-		else
> >>>-			puts("spl: mmc: wrong boot mode\n");
> >>>+		puts("spl: mmc: wrong boot mode\n");
> >>>  #endif
> >>>  		hang();
> >>
> >>The above hang() can be removed now.
> >>
> >
> >Not true. If CONFIG_SPL_LIBCOMMON_SUPPORT is not defined this part will
> >be just:
> >
> >default:
> >}
> >
> >Which is a compile error (label at the end of compound statement).
> 
> Easy to fix, put the default: in the #ifdef too.

Right. OK, noted for V2.

> 
> Otherwise you have:
> 
> 		hang();
> 	}
> 	hang();
> 
> Which is just ugly code IMHO.
> 
> Regards,
> 
> Hans
> 
> 	
> >
> >>>  	}
> >>>+
> >>>+	hang();
> >>>  }
> >>>
> >>
> >>Regards,
> >>
> >>Hans
> >>
> 


More information about the U-Boot mailing list