* [PATCH v2 1/1] fs: error handling in do_load()
@ 2020-06-29 18:08 Heinrich Schuchardt
2020-07-03 0:45 ` Simon Glass
2020-07-17 20:58 ` Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2020-06-29 18:08 UTC (permalink / raw)
To: u-boot
If a file cannot be loaded, show an error message.
Set the EFI boot device only after successfully loading a file.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
v2:
use if() instead of #ifdef
---
fs/fs.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/fs/fs.c b/fs/fs.c
index ad4caaeb1e..7268ec87aa 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -715,15 +715,17 @@ int do_load(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
else
pos = 0;
-#ifdef CONFIG_CMD_BOOTEFI
- efi_set_bootdev(argv[1], (argc > 2) ? argv[2] : "",
- (argc > 4) ? argv[4] : "");
-#endif
time = get_timer(0);
ret = _fs_read(filename, addr, pos, bytes, 1, &len_read);
time = get_timer(time);
- if (ret < 0)
+ if (ret < 0) {
+ printf("Failed to load '%s'\n", filename);
return 1;
+ }
+
+ if (IS_ENABLED(CONFIG_CMD_BOOTEFI))
+ efi_set_bootdev(argv[1], (argc > 2) ? argv[2] : "",
+ (argc > 4) ? argv[4] : "");
printf("%llu bytes read in %lu ms", len_read, time);
if (time > 0) {
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 1/1] fs: error handling in do_load()
2020-06-29 18:08 [PATCH v2 1/1] fs: error handling in do_load() Heinrich Schuchardt
@ 2020-07-03 0:45 ` Simon Glass
2020-07-17 20:58 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2020-07-03 0:45 UTC (permalink / raw)
To: u-boot
On Mon, 29 Jun 2020 at 12:08, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> If a file cannot be loaded, show an error message.
> Set the EFI boot device only after successfully loading a file.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> v2:
> use if() instead of #ifdef
> ---
> fs/fs.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/1] fs: error handling in do_load()
2020-06-29 18:08 [PATCH v2 1/1] fs: error handling in do_load() Heinrich Schuchardt
2020-07-03 0:45 ` Simon Glass
@ 2020-07-17 20:58 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2020-07-17 20:58 UTC (permalink / raw)
To: u-boot
On Mon, Jun 29, 2020 at 08:08:49PM +0200, Heinrich Schuchardt wrote:
> If a file cannot be loaded, show an error message.
> Set the EFI boot device only after successfully loading a file.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200717/f015acc5/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-17 20:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 18:08 [PATCH v2 1/1] fs: error handling in do_load() Heinrich Schuchardt
2020-07-03 0:45 ` Simon Glass
2020-07-17 20:58 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.