[PATCH 1/1] efi_loader: remove ERROR:, WARNING: prefixes in messages

Simon Glass sjg at chromium.org
Fri Oct 18 16:54:35 CEST 2024


On Thu, 17 Oct 2024 at 12:19, Ilias Apalodimas
<ilias.apalodimas at linaro.org> wrote:
>
> On Thu, 17 Oct 2024 at 21:13, Heinrich Schuchardt
> <heinrich.schuchardt at canonical.com> wrote:
> >
> > We should not write "ERROR:" or "WARNING:" when using log_err() or
> > log_warning(). These prefixed don't provide additional information.
> >
> > Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> > ---
> >  lib/efi_loader/efi_helper.c | 20 ++++++++++----------
> >  1 file changed, 10 insertions(+), 10 deletions(-)
> >
> > diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c
> > index a481eb4b7e3..00167bd2a10 100644
> > --- a/lib/efi_loader/efi_helper.c
> > +++ b/lib/efi_loader/efi_helper.c
> > @@ -412,7 +412,7 @@ static efi_status_t copy_fdt(void **fdtp)
> >                                  EFI_ACPI_RECLAIM_MEMORY, fdt_pages,
> >                                  &new_fdt_addr);
> >         if (ret != EFI_SUCCESS) {
> > -               log_err("ERROR: Failed to reserve space for FDT\n");
> > +               log_err("Failed to reserve space for FDT\n");
> >                 goto done;
> >         }
> >         new_fdt = (void *)(uintptr_t)new_fdt_addr;
> > @@ -468,7 +468,7 @@ efi_status_t efi_install_fdt(void *fdt)
> >          * but not both.
> >          */
> >         if (CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE) && fdt)
> > -               log_warning("WARNING: Can't have ACPI table and device tree - ignoring DT.\n");
> > +               log_warning("Can't have ACPI table and device tree - ignoring DT.\n");
> >
> >         if (fdt == EFI_FDT_USE_INTERNAL) {
> >                 const char *fdt_opt;
> > @@ -483,13 +483,13 @@ efi_status_t efi_install_fdt(void *fdt)
> >                 if (!fdt_opt) {
> >                         fdt_opt = env_get("fdtcontroladdr");
> >                         if (!fdt_opt) {
> > -                               log_err("ERROR: need device tree\n");
> > +                               log_err("need device tree\n");
> >                                 return EFI_NOT_FOUND;
> >                         }
> >                 }
> >                 fdt_addr = hextoul(fdt_opt, NULL);
> >                 if (!fdt_addr) {
> > -                       log_err("ERROR: invalid $fdt_addr or $fdtcontroladdr\n");
> > +                       log_err("invalid $fdt_addr or $fdtcontroladdr\n");
> >                         return EFI_LOAD_ERROR;
> >                 }
> >                 fdt = map_sysmem(fdt_addr, 0);
> > @@ -497,7 +497,7 @@ efi_status_t efi_install_fdt(void *fdt)
> >
> >         /* Install device tree */
> >         if (fdt_check_header(fdt)) {
> > -               log_err("ERROR: invalid device tree\n");
> > +               log_err("invalid device tree\n");
> >                 return EFI_LOAD_ERROR;
> >         }
> >
> > @@ -510,12 +510,12 @@ efi_status_t efi_install_fdt(void *fdt)
> >         /* Prepare device tree for payload */
> >         ret = copy_fdt(&fdt);
> >         if (ret) {
> > -               log_err("ERROR: out of memory\n");
> > +               log_err("out of memory\n");
> >                 return EFI_OUT_OF_RESOURCES;
> >         }
> >
> >         if (image_setup_libfdt(&img, fdt, false)) {
> > -               log_err("ERROR: failed to process device tree\n");
> > +               log_err("failed to process device tree\n");
> >                 return EFI_LOAD_ERROR;
> >         }
> >
> > @@ -527,7 +527,7 @@ efi_status_t efi_install_fdt(void *fdt)
> >         if (CONFIG_IS_ENABLED(EFI_TCG2_PROTOCOL_MEASURE_DTB)) {
> >                 ret = efi_tcg2_measure_dtb(fdt);
> >                 if (ret == EFI_SECURITY_VIOLATION) {
> > -                       log_err("ERROR: failed to measure DTB\n");
> > +                       log_err("failed to measure DTB\n");
> >                         return ret;
> >                 }
> >         }
> > @@ -535,7 +535,7 @@ efi_status_t efi_install_fdt(void *fdt)
> >         /* Install device tree as UEFI table */
> >         ret = efi_install_configuration_table(&efi_guid_fdt, fdt);
> >         if (ret != EFI_SUCCESS) {
> > -               log_err("ERROR: failed to install device tree\n");
> > +               log_err("failed to install device tree\n");
> >                 return ret;
> >         }
> >
> > @@ -574,7 +574,7 @@ efi_status_t do_bootefi_exec(efi_handle_t handle, void *load_options)
> >          */
> >         ret = efi_set_watchdog(300);
> >         if (ret != EFI_SUCCESS) {
> > -               log_err("ERROR: Failed to set watchdog timer\n");
> > +               log_err("failed to set watchdog timer\n");
> >                 goto out;
> >         }
> >
> > --
> > 2.45.2
> >
>
> Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list