[U-Boot] [PATCH v1 3/3] Remove the bootm_find_other() wrapper

Simon Glass sjg at chromium.org
Fri May 15 15:58:08 CEST 2015


Hi Karl,

On 13 May 2015 at 06:54, Karl Apsite <Karl.Apsite at dornerworks.com> wrote:
> The bootm_find_other() function was only called once, and ran a quick
> check before it called bootm_find_images(). This wrapper function was
> removed by moving the conditional to do_bootm_states (where find_other
> was being called) and calling bootm_find_images directly.
>
> Signed-off-by: Karl Apsite <Karl.Apsite at dornerworks.com>
> ---
>
>  common/bootm.c | 23 +++++++++--------------
>  1 file changed, 9 insertions(+), 14 deletions(-)
>
> diff --git a/common/bootm.c b/common/bootm.c
> index ae0d674..13f2bc9 100644
> --- a/common/bootm.c
> +++ b/common/bootm.c
> @@ -241,19 +241,6 @@ int bootm_find_images(int flag, int argc, char * const argv[])
>
>         return 0;
>  }
> -
> -static int bootm_find_other(cmd_tbl_t *cmdtp, int flag, int argc,
> -                           char * const argv[])
> -{
> -       if (((images.os.type == IH_TYPE_KERNEL) ||
> -            (images.os.type == IH_TYPE_KERNEL_NOLOAD) ||
> -            (images.os.type == IH_TYPE_MULTI)) &&
> -           (images.os.os == IH_OS_LINUX ||
> -                images.os.os == IH_OS_VXWORKS))
> -               return bootm_find_images(flag, argc, argv);
> -
> -       return 0;
> -}
>  #endif /* USE_HOSTC */
>
>  /**
> @@ -581,7 +568,15 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
>                 ret = bootm_find_os(cmdtp, flag, argc, argv);
>
>         if (!ret && (states & BOOTM_STATE_FINDOTHER)) {
> -               ret = bootm_find_other(cmdtp, flag, argc, argv);
> +               if (((images.os.type == IH_TYPE_KERNEL) ||
> +                    (images.os.type == IH_TYPE_KERNEL_NOLOAD) ||
> +                    (images.os.type == IH_TYPE_MULTI)) &&
> +                   (images.os.os == IH_OS_LINUX ||
> +                        images.os.os == IH_OS_VXWORKS))
> +                       ret = bootm_find_images(flag, argc, argv);
> +               else
> +                       ret = 0;
> +

do_bootm_states() is already too long. Can we keep the
bootm_find_other() function? Calling it here matches the rest of the
code within do_bootm_states().

>                 argc = 0;       /* consume the args */
>         }
>
> --
> 2.3.7
>

Regards,
Simon


More information about the U-Boot mailing list