pci: Fix pci_host_generic_acpi with gcc

In pci_host_generic_acpi.c we loop over pci_acpi_quirks to check if
we need to handle any quirks. GCC doesn't like the terminatin as it
sets a fixed width string to 0.

As this the array is only ever used in this file change to use nitems
to find when to stop the loop.

Reviewed by:	brooks, imp, jhb, emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45265
This commit is contained in:
Andrew Turner 2024-05-22 08:19:38 +00:00
parent 4f012d7a7a
commit f55e866488

View file

@ -99,7 +99,6 @@ static struct {
{ "MVEBU ", "CN9130 ", PCIE_ECAM_DESIGNWARE_QUIRK },
{ "MVEBU ", "CN9131 ", PCIE_ECAM_DESIGNWARE_QUIRK },
{ "MVEBU ", "CN9132 ", PCIE_ECAM_DESIGNWARE_QUIRK },
{ 0 },
};
/* Forward prototypes */
@ -202,9 +201,9 @@ static void
pci_host_acpi_get_oem_quirks(struct generic_pcie_acpi_softc *sc,
ACPI_TABLE_HEADER *hdr)
{
int i;
size_t i;
for (i = 0; pci_acpi_quirks[i].quirks; i++) {
for (i = 0; i < nitems(pci_acpi_quirks); i++) {
if (memcmp(hdr->OemId, pci_acpi_quirks[i].oem_id,
ACPI_OEM_ID_SIZE) != 0)
continue;