mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 05:21:49 +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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,15 +291,14 @@ static int efipci_start ( struct efi_device *efidev ) {
|
||||
EFI_OPEN_PROTOCOL_EXCLUSIVE ),
|
||||
pci ) ) != 0 ) {
|
||||
DBGC ( device, "EFIPCI %p %s could not open PCI device: %s\n",
|
||||
device, efi_devpath_text ( efidev->path ),
|
||||
strerror ( rc ) );
|
||||
device, efi_handle_name ( device ), strerror ( rc ) );
|
||||
goto err_open;
|
||||
}
|
||||
|
||||
/* Find driver */
|
||||
if ( ( rc = pci_find_driver ( pci ) ) != 0 ) {
|
||||
DBGC ( device, "EFIPCI %p %s has no driver\n",
|
||||
device, efi_devpath_text ( efidev->path ) );
|
||||
device, efi_handle_name ( device ) );
|
||||
goto err_find_driver;
|
||||
}
|
||||
|
||||
@@ -310,12 +309,12 @@ static int efipci_start ( struct efi_device *efidev ) {
|
||||
/* Probe driver */
|
||||
if ( ( rc = pci_probe ( pci ) ) != 0 ) {
|
||||
DBGC ( device, "EFIPCI %p %s could not probe driver \"%s\": "
|
||||
"%s\n", device, efi_devpath_text ( efidev->path ),
|
||||
"%s\n", device, efi_handle_name ( device ),
|
||||
pci->id->name, strerror ( rc ) );
|
||||
goto err_probe;
|
||||
}
|
||||
DBGC ( device, "EFIPCI %p %s using driver \"%s\"\n", device,
|
||||
efi_devpath_text ( efidev->path ), pci->id->name );
|
||||
DBGC ( device, "EFIPCI %p %s using driver \"%s\"\n",
|
||||
device, efi_handle_name ( device ), pci->id->name );
|
||||
|
||||
efidev_set_drvdata ( efidev, pci );
|
||||
return 0;
|
||||
|
||||
@@ -1045,7 +1045,7 @@ static int efi_snp_probe ( struct net_device *netdev ) {
|
||||
if ( ( rc = efidev_child_add ( efidev, snpdev->handle ) ) != 0 ) {
|
||||
DBGC ( snpdev, "SNPDEV %p could not become child of %p %s: "
|
||||
"%s\n", snpdev, efidev->device,
|
||||
efi_devpath_text ( efidev->path ), strerror ( rc ) );
|
||||
efi_handle_name ( efidev->device ), strerror ( rc ) );
|
||||
goto err_efidev_child_add;
|
||||
}
|
||||
|
||||
@@ -1064,7 +1064,7 @@ static int efi_snp_probe ( struct net_device *netdev ) {
|
||||
|
||||
DBGC ( snpdev, "SNPDEV %p installed for %s as device %p %s\n",
|
||||
snpdev, netdev->name, snpdev->handle,
|
||||
efi_devpath_text ( &snpdev->path ) );
|
||||
efi_handle_name ( snpdev->handle ) );
|
||||
return 0;
|
||||
|
||||
if ( snpdev->package_list )
|
||||
|
||||
Reference in New Issue
Block a user