From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC 4/8] cmd: bootefi: move do_bootefi_bootmgr_exec() forward
Date: Fri, 22 Mar 2019 11:16:35 +0900 [thread overview]
Message-ID: <20190322021634.GN9937@linaro.org> (raw)
In-Reply-To: <92c0ca2c-cd99-9790-b6d2-42c3095b3dd6@gmx.de>
On Thu, Mar 21, 2019 at 12:48:53PM +0100, Heinrich Schuchardt wrote:
> On 3/5/19 6:53 AM, AKASHI Takahiro wrote:
> > This is a preparatory patch.
> >
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > ---
> > cmd/bootefi.c | 42 +++++++++++++++++++++---------------------
> > 1 file changed, 21 insertions(+), 21 deletions(-)
> >
> > diff --git a/cmd/bootefi.c b/cmd/bootefi.c
> > index 3619a20e6433..1d90e7b4b575 100644
> > --- a/cmd/bootefi.c
> > +++ b/cmd/bootefi.c
> > @@ -314,6 +314,27 @@ err_add_protocol:
> > return ret;
> > }
> >
> > +static int do_bootefi_bootmgr_exec(void)
> > +{
> > + struct efi_device_path *device_path, *file_path;
> > + void *addr;
> > + efi_status_t r;
> > +
> > + addr = efi_bootmgr_load(&device_path, &file_path);
> > + if (!addr)
> > + return 1;
> > +
> > + printf("## Starting EFI application at %p ...\n", addr);
> > + r = do_bootefi_exec(addr, device_path, file_path);
> > + printf("## Application terminated, r = %lu\n",
> > + r & ~EFI_ERROR_MASK);
> > + if (r != EFI_SUCCESS)
> > + return 1;
>
> return CMD_RET_FAILURE ?
>
> > +
> > + return 0;
>
> return CMD_RET_SUCCESS ?
>
> The lines following efi_bootmgr_load() are duplicating code from
> do_bootefi().
do_bootefi() -> do_boot_efi()?
> The patch itself is ok. But in the patch series we should get rid of the
> duplication.
We only share:
> > + printf("## Starting EFI application at %p ...\n", addr);
> > + r = do_bootefi_exec(addr, device_path, file_path);
> > + printf("## Application terminated, r = %lu\n",
> > + r & ~EFI_ERROR_MASK);
> > + if (r != EFI_SUCCESS)
> > + return 1;
Can we call it a duplication?
# I don't like the print messages here anyway.
-Takahiro Akashi
> Best regards
>
> Heinrich
>
> > +}
> > +
> > #ifdef CONFIG_CMD_BOOTEFI_SELFTEST
> > /**
> > * bootefi_test_prepare() - prepare to run an EFI test
> > @@ -362,27 +383,6 @@ failure:
> >
> > #endif /* CONFIG_CMD_BOOTEFI_SELFTEST */
> >
> > -static int do_bootefi_bootmgr_exec(void)
> > -{
> > - struct efi_device_path *device_path, *file_path;
> > - void *addr;
> > - efi_status_t r;
> > -
> > - addr = efi_bootmgr_load(&device_path, &file_path);
> > - if (!addr)
> > - return 1;
> > -
> > - printf("## Starting EFI application at %p ...\n", addr);
> > - r = do_bootefi_exec(addr, device_path, file_path);
> > - printf("## Application terminated, r = %lu\n",
> > - r & ~EFI_ERROR_MASK);
> > -
> > - if (r != EFI_SUCCESS)
> > - return 1;
> > -
> > - return 0;
> > -}
> > -
> > /* Interpreter command to boot an arbitrary EFI image from memory */
> > static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> > {
> >
>
next prev parent reply other threads:[~2019-03-22 2:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-05 5:53 [U-Boot] [RFC 0/8] efi_loader: rework bootefi/bootmgr AKASHI Takahiro
2019-03-05 5:53 ` [U-Boot] [RFC 1/8] efi_loader: boottime: don't add device path protocol to image handle AKASHI Takahiro
2019-03-05 19:48 ` Heinrich Schuchardt
2019-03-06 0:27 ` AKASHI Takahiro
2019-03-06 5:04 ` Heinrich Schuchardt
2019-03-06 5:29 ` Heinrich Schuchardt
2019-03-27 2:50 ` AKASHI Takahiro
2019-03-05 5:53 ` [U-Boot] [RFC 2/8] efi_loader: boottime: export efi_[un]load_image() AKASHI Takahiro
2019-03-05 20:02 ` Heinrich Schuchardt
2019-03-05 5:53 ` [U-Boot] [RFC 3/8] efi_loader: bootmgr: return pointer and size of buffer in loading AKASHI Takahiro
2019-03-21 11:41 ` Heinrich Schuchardt
2019-03-22 2:08 ` AKASHI Takahiro
2019-03-05 5:53 ` [U-Boot] [RFC 4/8] cmd: bootefi: move do_bootefi_bootmgr_exec() forward AKASHI Takahiro
2019-03-21 11:48 ` Heinrich Schuchardt
2019-03-22 2:16 ` AKASHI Takahiro [this message]
2019-03-05 5:53 ` [U-Boot] [RFC 5/8] cmd: bootefi: carve out fdt handling AKASHI Takahiro
2019-03-05 5:53 ` [U-Boot] [RFC 6/8] cmd: bootefi: carve out efi_selftest code from do_bootefi() AKASHI Takahiro
2019-03-05 5:53 ` [U-Boot] [RFC 7/8] cmd: bootefi: rework do_bootefi(), using load_image API AKASHI Takahiro
2019-03-05 5:53 ` [U-Boot] [RFC 8/8] cmd: add efibootmgr command AKASHI Takahiro
2019-03-19 7:23 ` [U-Boot] [RFC 0/8] efi_loader: rework bootefi/bootmgr AKASHI Takahiro
2019-03-21 6:41 ` Heinrich Schuchardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190322021634.GN9937@linaro.org \
--to=takahiro.akashi@linaro.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox