From nobody Thu Feb 27 14:17:32 2025 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 4Z3YMK1RWTz5qGFW; Thu, 27 Feb 2025 14:17:33 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMK0mfMz3xNG; Thu, 27 Feb 2025 14:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665853; 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=Ev9fEKAzgXv8MQZNY/U3XGHknOPtJ13fRPeBFA3v0R4=; b=gDrmAngIsC0I5wkvFdmkz24MJSOMCEJyr0m3OQ7G6C2UlQ23ZAyArjh5wWr4CXIB72oa98 LCAJCDXWD//Qb9D7Rpl/Rim+nHheIqe3Nso7vfFPB4rksp5o4I17+MAZredFTR5LH1RZQZ N/GG9nz7h4Pbd/VcGTecH1ZYAlxLFgGvG/JYlqK+3UJRdOrm5QloQzF9GkzHXt47w06rwL Bu/xzUFvmo8LHQY0a4eJPhNpGygvGxhAi6UIWfZbuBvK/ZnVbqeRC7ym1Yh3q9p0BHcKPv zprqu8gKkaqUXqdWP8U2yoAZWo84NihPOD/XJvSDYbVJim77oJZK9oQ+OQJGPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665853; a=rsa-sha256; cv=none; b=RPmV3sG6xwYppSaPBqknX32mI65Xpzbo7i1pJjYA+N0hd7MjFcIPxUMB1BfSrXH1cw+e1w ELR8aZoRd0x5QBuCF+2UQiD/2vhoWaBy7vX5gf+FiRiwjl/3DXVFnfY7dshLghbf8nThEQ wPXje2ts8RdZ2P9P0QGqlE8GN1n9KQrjL4Ccjp1d/X76/hGNtI2jOn8oSbBJTd9hvqQ16M pn7dT1Lm5hZfj3jtsBcmSk7MWUa8cs2o/oWmfLxlmT1nHZm2uHtvpx61N7zniQNWxHrg+8 f45ThQcFWsU4TFxmLM8QL/0MnCE7+Ck2bZPfn0dVON5/tZjfmLrbFWuAtbuAOw== 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=1740665853; 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=Ev9fEKAzgXv8MQZNY/U3XGHknOPtJ13fRPeBFA3v0R4=; b=TaypuihtIssC9rXGepBAIiCTR2cxWfq5JORdNctt5T19EorDORo9zuP72foL+6HDAR8C+0 KXO3o+6JMLkBErp73+2HAiD+YdIe7ek3AzFsYRfkU2+gBniyzWsCzdELAJaYNOnOKPVjml BdeJkkC5su8OrND1d3HQ0s8ytSn/neZoI+RbrtVhDcomuW8brH8SSlq7Iu2CvC7KsCKDfG 6IJq3MKr1VAw33pRoz9Rrj2JmkPAeTjEmc3l2QfJyhmDs/MRJaLYzkQcKFOKRqW5XrSN0S KrakdltM+C0Th77cI5B3GvqZHOZDqZxY3Lm00kO4zpMXEoN8iGzqdTqy+p9zBA== 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 4Z3YMK0NZXzmf2; Thu, 27 Feb 2025 14:17:33 +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 51REHWQh017573; Thu, 27 Feb 2025 14:17:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHWrI017570; Thu, 27 Feb 2025 14:17:32 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:32 GMT Message-Id: <202502271417.51REHWrI017570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a27c361e0503 - stable/14 - pci: Narrow the scope of recently-added PCI_IOV #ifdefs 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a27c361e050331cd50d5fc1a7230fce62eee536c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a27c361e050331cd50d5fc1a7230fce62eee536c commit a27c361e050331cd50d5fc1a7230fce62eee536c Author: John Baldwin AuthorDate: 2024-08-08 19:05:23 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:24 +0000 pci: Narrow the scope of recently-added PCI_IOV #ifdefs Push the #ifdefs down into the function body instead of defining functions conditionally for ease of readability. These aren't critical paths, so one extra branch in the !PCI_IOV case is not a big deal. Requested by: jrtc27 Differential Revision: https://reviews.freebsd.org/D45877 (cherry picked from commit 971c9f57d7e6b55161fecc008e19f00ccaba8060) --- sys/dev/pci/pci.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 4be3210840fc..b40a352a4818 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -164,18 +164,12 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_delete_resource, pci_delete_resource), DEVMETHOD(bus_alloc_resource, pci_alloc_resource), -#ifdef PCI_IOV DEVMETHOD(bus_adjust_resource, pci_adjust_resource), -#else - DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), -#endif DEVMETHOD(bus_release_resource, pci_release_resource), DEVMETHOD(bus_activate_resource, pci_activate_resource), DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource), -#ifdef PCI_IOV DEVMETHOD(bus_map_resource, pci_map_resource), DEVMETHOD(bus_unmap_resource, pci_unmap_resource), -#endif DEVMETHOD(bus_child_deleted, pci_child_deleted), DEVMETHOD(bus_child_detached, pci_child_detached), DEVMETHOD(bus_child_pnpinfo, pci_child_pnpinfo_method), @@ -5784,11 +5778,11 @@ pci_deactivate_resource(device_t dev, device_t child, int type, return (0); } -#ifdef PCI_IOV int pci_adjust_resource(device_t dev, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end) { +#ifdef PCI_IOV struct pci_devinfo *dinfo; if (device_get_parent(child) != dev) @@ -5808,6 +5802,7 @@ pci_adjust_resource(device_t dev, device_t child, int type, struct resource *r, /* Fall through for other types of resource allocations. */ } +#endif return (bus_generic_adjust_resource(dev, child, type, r, start, end)); } @@ -5816,6 +5811,7 @@ int pci_map_resource(device_t dev, device_t child, int type, struct resource *r, struct resource_map_request *argsp, struct resource_map *map) { +#ifdef PCI_IOV struct pci_devinfo *dinfo; if (device_get_parent(child) != dev) @@ -5835,6 +5831,7 @@ pci_map_resource(device_t dev, device_t child, int type, struct resource *r, /* Fall through for other types of resource allocations. */ } +#endif return (bus_generic_map_resource(dev, child, type, r, argsp, map)); } @@ -5843,6 +5840,7 @@ int pci_unmap_resource(device_t dev, device_t child, int type, struct resource *r, struct resource_map *map) { +#ifdef PCI_IOV struct pci_devinfo *dinfo; if (device_get_parent(child) != dev) @@ -5860,10 +5858,10 @@ pci_unmap_resource(device_t dev, device_t child, int type, struct resource *r, /* Fall through for other types of resource allocations. */ } +#endif return (bus_generic_unmap_resource(dev, child, type, r, map)); } -#endif void pci_child_deleted(device_t dev, device_t child)