From: Miao Yan Date: Mon, 4 Nov 2013 03:18:14 +0000 (+0800) Subject: common/cmd_bootm.c: fix subcommand processing in OS specific do_bootm_xxx() functions X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=5b629319cf58101b4d623017503d2437714e788a;p=u-boot.git common/cmd_bootm.c: fix subcommand processing in OS specific do_bootm_xxx() functions In commit "5c427e4: use BOOTM_STATE_OS_CMDLINE flag for plain bootm" and "3d187b3: Only pass BOOTM_STATE_OS_CMDLINE on PowerPC/MIPS", BOOTM_STATE_OS_CMDLINE was added to do_bootm for PowerPC and MIPS. This breaks other OSes (vxworks, netbsd, plan9,...) that don't support subcommand processing, e.g. they all contain the following code in their do_bootm_xxx(): if (flag & BOOTM_STATE_OS_PREP) return 0; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; which will result a "subcommand not supported" error. This patch changes the above logic to: /* if not go command, pretend everything to be OK */ if (flag != BOOTM_STATE_OS_GO) return 0; Signed-off-by: Miao Yan --- diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 166b901d76..ba73f5781a 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -1469,10 +1469,8 @@ static int do_bootm_netbsd(int flag, int argc, char * const argv[], char *consdev; char *cmdline; - if (flag & BOOTM_STATE_OS_PREP) + if (flag != BOOTM_STATE_OS_GO) return 0; - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) - return 1; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { @@ -1550,10 +1548,8 @@ static int do_bootm_lynxkdi(int flag, int argc, char * const argv[], { image_header_t *hdr = &images->legacy_hdr_os_copy; - if (flag & BOOTM_STATE_OS_PREP) + if (flag != BOOTM_STATE_OS_GO) return 0; - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) - return 1; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { @@ -1574,10 +1570,8 @@ static int do_bootm_rtems(int flag, int argc, char * const argv[], { void (*entry_point)(bd_t *); - if (flag & BOOTM_STATE_OS_PREP) + if (flag != BOOTM_STATE_OS_GO) return 0; - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) - return 1; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { @@ -1609,10 +1603,8 @@ static int do_bootm_ose(int flag, int argc, char * const argv[], { void (*entry_point)(void); - if (flag & BOOTM_STATE_OS_PREP) + if (flag != BOOTM_STATE_OS_GO) return 0; - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) - return 1; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { @@ -1645,10 +1637,8 @@ static int do_bootm_plan9(int flag, int argc, char * const argv[], void (*entry_point)(void); char *s; - if (flag & BOOTM_STATE_OS_PREP) + if (flag != BOOTM_STATE_OS_GO) return 0; - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) - return 1; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { @@ -1694,10 +1684,8 @@ static int do_bootm_vxworks(int flag, int argc, char * const argv[], { char str[80]; - if (flag & BOOTM_STATE_OS_PREP) + if (flag != BOOTM_STATE_OS_GO) return 0; - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) - return 1; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { @@ -1719,10 +1707,8 @@ static int do_bootm_qnxelf(int flag, int argc, char * const argv[], char *local_args[2]; char str[16]; - if (flag & BOOTM_STATE_OS_PREP) + if (flag != BOOTM_STATE_OS_GO) return 0; - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) - return 1; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { @@ -1746,10 +1732,8 @@ static int do_bootm_integrity(int flag, int argc, char * const argv[], { void (*entry_point)(void); - if (flag & BOOTM_STATE_OS_PREP) + if (flag != BOOTM_STATE_OS_GO) return 0; - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) - return 1; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) {