]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: simplify error message in efi_disk_create_raw()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 2 Feb 2024 14:12:52 +0000 (15:12 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 12 Feb 2024 16:35:34 +0000 (17:35 +0100)
The error message

    Adding disk for usb_mass_storage.lun0 failed (err=-9223372036854775788/0x8000000000000014)

provides a decimal and a hexadecimal notation of the EFI status code
EFI_ALREADY_STARTED which is defined as (EFI_ERROR_MASK | 20).
The decimal output does not convey the value 20 clearly.

With the patch we write

    Adding block device usb_mass_storage.lun0 failed, r = 20

similar to other EFI error messages.

Fixes: 952018117ab4 ("dm: sandbox: Switch over to using the new host uclass")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_loader/efi_disk.c

index b1739d99201c3788be614bc6c2b07ad08666908a..93a9a5ac025068328aba35fcb278e2b77cd8da92 100644 (file)
@@ -574,7 +574,8 @@ static int efi_disk_create_raw(struct udevice *dev, efi_handle_t agent_handle)
                        log_notice("Disk %s not ready\n", dev->name);
                        ret = -EBUSY;
                } else {
-                       log_err("Adding disk for %s failed (err=%ld/%#lx)\n", dev->name, ret, ret);
+                       log_err("Adding block device %s failed, r = %lu\n",
+                               dev->name, ret & ~EFI_ERROR_MASK);
                        ret = -ENOENT;
                }