mirror of
https://github.com/ipxe/ipxe
synced 2026-01-01 09:09:32 +03:00
[efi] Use efi_handle_name() instead of efi_devpath_text() where applicable
Using efi_devpath_text() is marginally more efficient if we already have the device path protocol available, but the mild increase in efficiency is not worth compromising the clarity of the pattern: DBGC ( device, "THING %p %s ...", device, efi_handle_name ( device ) ); Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -238,12 +238,12 @@ static int efi_bofm_start ( struct efi_device *efidev ) {
|
||||
&bofm1.interface ) ) != 0 ) {
|
||||
rc = -EEFI ( efirc );
|
||||
DBGC ( device, "EFIBOFM %p %s cannot find BOFM protocol\n",
|
||||
device, efi_devpath_text ( efidev->path ) );
|
||||
device, efi_handle_name ( device ) );
|
||||
goto err_locate_bofm;
|
||||
}
|
||||
bofmtab = &bofm1.bofm1->BofmTable;
|
||||
DBGC ( device, "EFIBOFM %p %s found version 1 BOFM table at %p+%04x\n",
|
||||
device, efi_devpath_text ( efidev->path ), bofmtab,
|
||||
device, efi_handle_name ( device ), bofmtab,
|
||||
bofmtab->Parameters.Length );
|
||||
|
||||
/* Locate BOFM2 protocol, if available */
|
||||
@@ -251,35 +251,35 @@ static int efi_bofm_start ( struct efi_device *efidev ) {
|
||||
&bofm2.interface ) ) == 0 ) {
|
||||
bofmtab2 = &bofm2.bofm2->BofmTable;
|
||||
DBGC ( device, "EFIBOFM %p %s found version 2 BOFM table at "
|
||||
"%p+%04x\n", device, efi_devpath_text ( efidev->path ),
|
||||
"%p+%04x\n", device, efi_handle_name ( device ),
|
||||
bofmtab2, bofmtab2->Parameters.Length );
|
||||
assert ( bofm2.bofm2->RegisterSupport ==
|
||||
bofm1.bofm1->RegisterSupport );
|
||||
} else {
|
||||
DBGC ( device, "EFIBOFM %p %s cannot find BOFM2 protocol\n",
|
||||
device, efi_devpath_text ( efidev->path ) );
|
||||
device, efi_handle_name ( device ) );
|
||||
/* Not a fatal error; may be a BOFM1-only system */
|
||||
bofmtab2 = NULL;
|
||||
}
|
||||
|
||||
/* Process BOFM table */
|
||||
DBGC2 ( device, "EFIBOFM %p %s version 1 before processing:\n",
|
||||
device, efi_devpath_text ( efidev->path ) );
|
||||
device, efi_handle_name ( device ) );
|
||||
DBGC2_HD ( device, bofmtab, bofmtab->Parameters.Length );
|
||||
if ( bofmtab2 ) {
|
||||
DBGC2 ( device, "EFIBOFM %p %s version 2 before processing:\n",
|
||||
device, efi_devpath_text ( efidev->path ) );
|
||||
device, efi_handle_name ( device ) );
|
||||
DBGC2_HD ( device, bofmtab2, bofmtab2->Parameters.Length );
|
||||
}
|
||||
bofmrc = bofm ( virt_to_user ( bofmtab2 ? bofmtab2 : bofmtab ), &pci );
|
||||
DBGC ( device, "EFIBOFM %p %s status %08x\n",
|
||||
device, efi_devpath_text ( efidev->path ), bofmrc );
|
||||
device, efi_handle_name ( device ), bofmrc );
|
||||
DBGC2 ( device, "EFIBOFM %p %s version 1 after processing:\n",
|
||||
device, efi_devpath_text ( efidev->path ) );
|
||||
device, efi_handle_name ( device ) );
|
||||
DBGC2_HD ( device, bofmtab, bofmtab->Parameters.Length );
|
||||
if ( bofmtab2 ) {
|
||||
DBGC2 ( device, "EFIBOFM %p %s version 2 after processing:\n",
|
||||
device, efi_devpath_text ( efidev->path ) );
|
||||
device, efi_handle_name ( device ) );
|
||||
DBGC2_HD ( device, bofmtab2, bofmtab2->Parameters.Length );
|
||||
}
|
||||
|
||||
@@ -289,9 +289,8 @@ static int efi_bofm_start ( struct efi_device *efidev ) {
|
||||
FALSE, bofmrc ) ) != 0){
|
||||
rc = -EEFI ( efirc );
|
||||
DBGC ( device, "EFIBOFM %p %s could not set BOFM2 "
|
||||
"status: %s\n",
|
||||
device, efi_devpath_text ( efidev->path ),
|
||||
strerror ( rc ) );
|
||||
"status: %s\n", device,
|
||||
efi_handle_name ( device ), strerror ( rc ) );
|
||||
goto err_set_status;
|
||||
}
|
||||
} else {
|
||||
@@ -299,9 +298,8 @@ static int efi_bofm_start ( struct efi_device *efidev ) {
|
||||
FALSE, bofmrc ) ) != 0){
|
||||
rc = -EEFI ( efirc );
|
||||
DBGC ( device, "EFIBOFM %p %s could not set BOFM "
|
||||
"status: %s\n",
|
||||
device, efi_devpath_text ( efidev->path ),
|
||||
strerror ( rc ) );
|
||||
"status: %s\n", device,
|
||||
efi_handle_name ( device ), strerror ( rc ) );
|
||||
goto err_set_status;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user