diff options
author | Nikita Kiryanov <nikita@compulab.co.il> | 2015-11-08 17:11:43 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-11-18 14:49:59 -0500 |
commit | fd61d39970b9901217efc7536d9f3a61b4e1752a (patch) | |
tree | abb731b7e10785b81fcf74121a85c8c036c2f039 /common/cmd_reiser.c | |
parent | 483ab3dc8037878ae5dc7af5f0af7bf7ecc36897 (diff) | |
download | talos-obmc-uboot-fd61d39970b9901217efc7536d9f3a61b4e1752a.tar.gz talos-obmc-uboot-fd61d39970b9901217efc7536d9f3a61b4e1752a.zip |
spl: mmc: add break statements in spl_mmc_load_image()
The original intention of the mmc load_image() function was to try multiple
boot modes before failing. This is evident by the lack of break statements
in the switch, and the following line in the default case:
puts("spl: mmc: no boot mode left to try\n");
This implementation is problematic because:
- The availability of alternative boot modes is very arbitrary since it
depends on the specific order of the switch cases. If your boot mode happens to
be the first case, then you'll have a bunch of other boot modes as alternatives.
If it happens to be the last case, then you have none.
- Opting in/out is tied to config options, so the only way for you to prevent an
alternative boot mode from being attempted is to give up on the feature completely.
- This implementation makes the code more complicated and difficult to
understand.
Address these issues by inserting a break statements between the cases to make the
function try only one boot mode.
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: Paul Kocialkowski <contact@paulk.fr>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common/cmd_reiser.c')
0 files changed, 0 insertions, 0 deletions