From nobody Mon Jul 15 12:38:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WN1vl52Hgz5Qrr0; Mon, 15 Jul 2024 12:38:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WN1vl22wvz4HVg; Mon, 15 Jul 2024 12:38:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721047107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tTMRqkHPuCTkNpZG7izBL2Ub8KryCVRGy4qgAQaHJAg=; b=FN1qsRvKR6sNBVdHIXiz/mz0R11xKN+aDwULBSO0XurfK2EHSSET2e7LQqpBZfpkOlWQ7J CKiskdIN5TXHv0gI3QRKVFuQC9MXAacz0x4IlR7ppYmWFhufUvKk0alFEv/EwOrNdowc5P UlWksSsGKiDZgJRb3f1V5CEyEa/omOps+LZt9/zK67t/RlZNqSm+RIFga5DdDRl0Vtuw7Z vkfTJqdXKsXhnS1TrIrLajg73ffbTWE1O5mfjddV3OBjvPAiPcEuwjcJRdgODYA1UogiKL whV/N9ZiKOH65eWEWH4hnXjLgp2zphSu68MXIo6Lzm34IzktvKGmBXe/jBgZmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721047107; a=rsa-sha256; cv=none; b=O3LGS6drsBY/U47p3E5jczix+U6ADifNlX/VfdDsHevLg6J/wN2iF6FSVXtBWjWwcqM6IE 3Uy8Ma2ZmPKG07MKeTmz0LZTKIWyOnwNh5RvElmNP+y/CF86VdfdyWTmBG2CSw/kHbj4wW uH1Eo5Cjk+D/z0/IMnEX+qgFMFtjexu8MofZrQY5cQGaFH7fPx7X+cVueP59+UaTFAcpCo 2eonoMOSCN+oOxGN1Rk2LXIFFK+MslBpSoFRNr65zXn5LSfsc1G/mWcQ0Pauu5SaBdkLCG XpA+hYNVModk8fCAFYBxU6tKMAPzn9Dk4729vMp4IQj0SHra3QARQw9V7w4AXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721047107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tTMRqkHPuCTkNpZG7izBL2Ub8KryCVRGy4qgAQaHJAg=; b=JAUE6bmwjaMEoVSGy9ZbFARiSzU3o9lO7t1JOK2i0prTyvbhMbJDszlheyslxiOWUTTb6+ 6gJoUzoVOQQaq4BZSgAd5al+jDbRWGJcUx5IbFW0WxxN8e4KnZwRGFQ0ac8OQvTIky2DE1 QxVTYgEaDRn/k9Lkka5cWQuTcpYDBPZ7yTszNP5MXmdTXqU5Pu0hFIWOWzx4P+HjaUVmLT garSKFmyiCsR6caB/LAUvTgvTBH5D0BiI5q6tix/O6bAQWbHKoTKMCqbBZrwL/Gr8fV00f BNcpoPtT0bnAXtPoeHLyi273JJFR1148rWPCh6eGuAj3tiWenKlWhqqg6DmbkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WN1vl1dhkzsJP; Mon, 15 Jul 2024 12:38:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46FCcR6j061408; Mon, 15 Jul 2024 12:38:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46FCcRSW061405; Mon, 15 Jul 2024 12:38:27 GMT (envelope-from git) Date: Mon, 15 Jul 2024 12:38:27 GMT Message-Id: <202407151238.46FCcRSW061405@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 0496539fe32d - stable/14 - pci: Fix pci_host_generic_acpi with gcc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0496539fe32d87b33baccee97ca2bf774f6bb56f Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0496539fe32d87b33baccee97ca2bf774f6bb56f commit 0496539fe32d87b33baccee97ca2bf774f6bb56f Author: Andrew Turner AuthorDate: 2024-05-22 08:19:38 +0000 Commit: Andrew Turner CommitDate: 2024-07-15 12:27:37 +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 2191ec4d655a..0cd17d5f5555 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 */ @@ -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;