From nobody Wed May 22 08:32:05 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 4Vkl0P40n3z5LD74; Wed, 22 May 2024 08:32:05 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vkl0P1jNDz4jRk; Wed, 22 May 2024 08:32:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716366725; 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=u7MusWWA25168oYBIUukXisEZeDZTnZOCPrHUpYzY/s=; b=HcNQ4vNbKIDnbeVoV3H8Jql6e4YzFFY5A6pLksqOWvoCovyuFK1eGjJ5WjB0L4eTJ1iIsR E28haBCnvJfpqn0H62uOBUFIzsmffmQFhpbXIAGxatXVWAzLLxPV30oepliPSIKmT+K8Vr qohL+n4PpnYawA1fbLhOcrhVT07zjj+BgDUJP2XWUguPBeG/Kgvdzy6U+HAOx2avOA2T9p 3aEfH2yO+p91BRHLM5cVsc6SfiFpg3GejqBP68OyZU+paV4Y148Vd4Y84GmVcam/8mjo8X lvDfxEZR/GsW4sYb7D0XmCmxK9+yNLgFbo91HPiGtRMzDoM7VsSvjteBruRI5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716366725; a=rsa-sha256; cv=none; b=HFM/huVUYmhQgIfbtOd/kiA/ZhbTOsWSY/p1GtT2VtW3eJIcHcD2g0GOYLVHFNP6xZiLFd kejIAXK/fLUhbRU4Bi7/tAwFZ7l1wKZMclERU1lOS66mdfE7KBxHNysIpji6OihJOzsS7G 0/pBxptaqi3Ijjpi46LBpNeUdVrlAMjE224RJiRvVLo+IAh06v0YLqpUl+1kMX1e1VKtcn 1nre51yQcMC/f6tNZm63d+bXVj1mRBsfSEMiCk3VM1t+NN0LA1h5oX6voMrIqUNt6EVRJe BuKqsMBUbFyD3Sge2QuE9vn0TxYS92SHBkj+mLIcRjgSz4jplgY5t7VQ8YzWug== 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=1716366725; 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=u7MusWWA25168oYBIUukXisEZeDZTnZOCPrHUpYzY/s=; b=HYA18HN8aLzbeNMa0FW93q23IZQLBMjNnzSytDFLLp0HZE4r81xPyGwW+jLfPvjghWhWV4 LXuaqndEArB8GriyzJhOmQOPcD1EEpduqmSCQh4z2g61VKNbr7JvNTnDW8AmOVYyw0EkGX 28MzBdMKt6oFqTqgqzIfAFDsN+QOTOLa3xVSdOJOQP/L+gZKKUqUyM65f1Y47q6+1toPAb Kcj6bx6iHP6A93gm5dqfcwc718EfRbxvlxcut+KLbtZpfvMOUdJwCnoEEzu0uIc7Zht92r lQaxGAcAvKCNJG+8g3HPL3fknzvSexGyomQPb8l709lKwefoDiq+Qd9Z0hXkNg== 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 4Vkl0P1L8wzxkC; Wed, 22 May 2024 08:32:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44M8W5w1009070; Wed, 22 May 2024 08:32:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44M8W5Ti009067; Wed, 22 May 2024 08:32:05 GMT (envelope-from git) Date: Wed, 22 May 2024 08:32:05 GMT Message-Id: <202405220832.44M8W5Ti009067@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: f55e866488ba - main - 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/main X-Git-Reftype: branch X-Git-Commit: f55e866488ba2d8bb5b79659ee84bec1fe7808fb Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f55e866488ba2d8bb5b79659ee84bec1fe7808fb commit f55e866488ba2d8bb5b79659ee84bec1fe7808fb Author: Andrew Turner AuthorDate: 2024-05-22 08:19:38 +0000 Commit: Andrew Turner CommitDate: 2024-05-22 08:19:38 +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 --- 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;