spl: fix calling "spl export .." more than once
PATCH 1/1 spl: fix calling "spl export .." more than once
running "spl export ..." more than once fails with:
Trying to execute a command out of order
Trying to execute a command out of order
Trying to execute a command out of order
Trying to execute a command out of order
Trying to execute a command out of order
Trying to execute a command out of order
ERROR prep subcommand failed!
Subcommand failed
reason is commmit:35fc84fa1f: Refactor the bootm command to reduce code duplication
It used "state != BOOTM_STATE_START" but state is a bitfield, so check if the bit BOOTM_STATE_START is not set. With this fix, "spl export ..." can called more than once ...
---
common/cmd_bootm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
common/cmd_bootm.c +2 -1
@@ -78,7 +78,8 @@ static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc,return CMD_RET_USAGE ; } -if (state !=BOOTM_STATE_START && images.state >= state) { +if (((state &BOOTM_STATE_START ) !=BOOTM_STATE_START ) && + images.state >= state) {printf ("Trying to execute a command out of order\n" );return CMD_RET_USAGE ; }
Signature · 1 line
2.1.0
PATCH 1/1 spl: fix calling "spl export .." more than once
Hi Heiko,
Quoted 12 lines · Heiko Schocher
running "spl export ..." more than once fails with:
Trying to execute a command out of order
Trying to execute a command out of order
Trying to execute a command out of order
Trying to execute a command out of order
Trying to execute a command out of order
Trying to execute a command out of order
ERROR prep subcommand failed!
Subcommand failed
Quoted 8 lines
reason is commmit:
35fc84fa1f: Refactor the bootm command to reduce code duplicationIt used "state !=
BOOTM_STATE_START" but state is a bitfield, so check if the bitBOOTM_STATE_STARTis not set. With this fix, "spl export ..." can called more than once ...Signed-off-by Heiko Schocher <[email protected]>
The original code expected that only one flag would be passed at once (I think that was always the case when the code was first changed). But that is not how we want it to work.
Quoted 10 lines
---
common/cmd_bootm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)common/cmd_bootm.c +0
-0
common/cmd_bootm.c static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc, · line 81
Quoted 5 lines
common/cmd_bootm.c +1
-1@@ -78,7 +78,8 @@ static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc,return CMD_RET_USAGE ; } -if (state !=BOOTM_STATE_START && images.state >= state) { + if (((state & BOOTM_STATE_START) != BOOTM_STATE_START) &&
Maybe simpler as:
if (!(state & BOOTM_STATE_START) &&
Quoted 8 lines
common/cmd_bootm.c +1
-1+ images.state >= state) {printf ("Trying to execute a command out of order\n" );return CMD_RET_USAGE ; } --2.1.0
Regards,
Simon
Quoted 14 lines · Heiko Schocher
running "spl export ..." more than once fails with:
Trying to execute a command out of order
Trying to execute a command out of order
Trying to execute a command out of order
Trying to execute a command out of order
Trying to execute a command out of order
Trying to execute a command out of order
ERROR prep subcommand failed!
Subcommand failedreason is commmit:
35fc84fa1f: Refactor the bootm command to reduce code duplication
Quoted 6 lines
It used "state !=
BOOTM_STATE_START" but state is a bitfield, so check if the bitBOOTM_STATE_STARTis not set. With this fix, "spl export ..." can called more than once ...Signed-off-by Heiko Schocher <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150306/5a0ca3b6/attachment.sig>