Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jul 2024 12:38:29 GMT
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: aedbe2058290 - stable/13 - pci: Fix pci_host_generic_acpi with gcc
Message-ID:  <202407151238.46FCcT3N061644@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=aedbe205829059cb1a2245d68d63398855cbab5d

commit aedbe205829059cb1a2245d68d63398855cbab5d
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2024-05-22 08:19:38 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2024-07-15 12:34:29 +0000

    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
    
    (cherry picked from commit f55e866488ba2d8bb5b79659ee84bec1fe7808fb)
---
 sys/dev/pci/pci_host_generic_acpi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sys/dev/pci/pci_host_generic_acpi.c b/sys/dev/pci/pci_host_generic_acpi.c
index 25a4197a2bdc..ca9845fff7c2 100644
--- a/sys/dev/pci/pci_host_generic_acpi.c
+++ b/sys/dev/pci/pci_host_generic_acpi.c
@@ -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 */
@@ -204,9 +203,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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202407151238.46FCcT3N061644>