Array cannot be NULL, remove always true comparision. ACPI spec

identifies the tested condition for _PRT as "BYTE value of 0", so the
remaining part of the conditionals is sufficient.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2015-02-16 22:18:43 +00:00
parent aed116911d
commit d19b0f3ea5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278871

View File

@ -95,7 +95,7 @@ prt_attach_devices(ACPI_PCI_ROUTING_TABLE *entry, void *arg)
int error;
/* We only care about entries that reference a link device. */
if (entry->Source == NULL || entry->Source[0] == '\0')
if (entry->Source[0] == '\0')
return;
/*
@ -222,7 +222,7 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
if (bootverbose) {
device_printf(pcib, "matched entry for %d.%d.INT%c",
pci_get_bus(dev), pci_get_slot(dev), 'A' + pin);
if (prt->Source != NULL && prt->Source[0] != '\0')
if (prt->Source[0] != '\0')
printf(" (src %s:%u)", prt->Source, prt->SourceIndex);
printf("\n");
}
@ -234,8 +234,7 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
* XXX: If the source index is non-zero, ignore the source device and
* assume that this is a hard-wired entry.
*/
if (prt->Source == NULL || prt->Source[0] == '\0' ||
prt->SourceIndex != 0) {
if (prt->Source[0] == '\0' || prt->SourceIndex != 0) {
if (bootverbose)
device_printf(pcib, "slot %d INT%c hardwired to IRQ %d\n",
pci_get_slot(dev), 'A' + pin, prt->SourceIndex);