From nobody Mon Jul 15 12:38:29 2024 X-Original-To: dev-commits-src-branches@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 4WN1vp36g6z5Qrvg; Mon, 15 Jul 2024 12:38:30 +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 4WN1vn6D2hz4HsG; Mon, 15 Jul 2024 12:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721047109; 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=A2x8sF3NUvLrmLvOwa0zKhP9XRsXiTlyW1tKTiV429c=; b=UPVTEP/GJ9bdOBk5kOHRcbR9XaE3V6EwglEtGnHuVEpoDvGZwMe6+R6Pn7CtPXEcxctzmn dOiXiR3fxSzmvDplIx1SoHYerxDAJm1Nemu447xQgnXjn/UKLxrd20TEc7tPCqFu1DD8Oe Tezs0jzyIl6+DI16uIa8gfPfL5lHF55CLw/xyUrbScMZ82xH9378VlsOUQPQgzDRwp/dtR zpm28LeFa4gN0lpC8U3i41/xCGsXhGqPYCn2hr9REqBdJr14iXutSrUWTgJDVgmAbYkddz fUBK8KVYh9w50vJOEX9i18U53Aahc9tVCArb+Yk8NOidw1kneJtgGg+eKIhUIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721047109; a=rsa-sha256; cv=none; b=oivdQ4SP1s/c33IuzjaUUcUQiFhqMLH8wY3CHwR5arPb8entMfsE+6hFMHwYMaoSYmVh+Z cQJHu1wheEHffRiX8Gg/5HK7lkWWYW3FJR4zz/wHOnW0yIGfk7yMBgBve8ADeFufSnx+O2 tiYUaGjlYxcF8I1i+U7JYAwEswH0Jt7j807UKgsuSgg1l2PygrGp7Ki+dvdTV1ogYQDSTr V5kNKnV0nWzfCR3jhCg2zqW4yosL/HL529UxKDgc3sohwrmrlbDnCSfFOdIUlkcBzfJrKz DpyZ5xlnsyS8Bo7wQu6lq599kYIt1mBuvE6lUSWYbm9vnp1KfwzXiw+X2f4IZw== 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=1721047109; 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=A2x8sF3NUvLrmLvOwa0zKhP9XRsXiTlyW1tKTiV429c=; b=UqlT0hwVbDIWM0f1Y/x9lcWBZPg1XTWMG26GfKIi1vLahBfRHbeCmAMEoOkEryCFt4Fmnf CqdXrHUvCEIz7CHszrjY0jM6Jj4bl3mHN3uz7nSxYgs76qOz8WWUehGxZ0SDVeY6W9Q/c6 NudfzAnl0Mv3h8hJhK/7t+lDHnbIsVKLst70QHKvd0Z59UwuFAKmHoGM/Zz0lgv89/bKGi HA8S/dib4kAuspjRQ7XrOci+8bQHj1X3herf7Vy8xgw7+plIsmbaU0oy0/Dv/RzGNJfgZh aGtrIfktvfPqFDqKd3hqsrkVtX8zQHJMJyG29HhYd53ZHFjD7k/R/teOPiSXdg== 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 4WN1vn5rg8zsJQ; Mon, 15 Jul 2024 12:38:29 +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 46FCcTHY061647; Mon, 15 Jul 2024 12:38:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46FCcT3N061644; Mon, 15 Jul 2024 12:38:29 GMT (envelope-from git) Date: Mon, 15 Jul 2024 12:38:29 GMT Message-Id: <202407151238.46FCcT3N061644@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: aedbe2058290 - stable/13 - pci: Fix pci_host_generic_acpi with gcc List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: aedbe205829059cb1a2245d68d63398855cbab5d Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=aedbe205829059cb1a2245d68d63398855cbab5d commit aedbe205829059cb1a2245d68d63398855cbab5d Author: Andrew Turner AuthorDate: 2024-05-22 08:19:38 +0000 Commit: Andrew Turner 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;