From nobody Tue Mar 05 04:53:43 2024 X-Original-To: dev-commits-src-main@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 4TpjrS2YcKz5Bn3n; Tue, 5 Mar 2024 04:53:44 +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 4TpjrS0NrGz4qlj; Tue, 5 Mar 2024 04:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709614424; 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=4Hxxm2zoIUTHW0ipDkrUpScpFC8n4e9uv4ZW6qdYFnI=; b=dRF4AHz6HgpsDtZ0dqx+Cx1I8nnooaL3ctb/av6bvSQ+7s+nuZGxIAhk+jpjidMuMLBqXT vKdeq+WRBvDUi94/ey+yXAo8elquO5A547zfI6BCKXZlsNMUTYV6/CV4qYoSLWA2QtpTmE Vax2hqqdV53HtJeYdq9d1kUhtW30DYombKrAG+LajJqA4wbudfgbVK2D2dySW8a4RykifM vxFSKqIncXoyU8CYBTmgjV7a7ppP83XejKS4dt3+EPzqS7kNK3cAsyNGLxomq4ZniW1xrR 5zZG4i9CMDYVMvaKi++V3RWQuVxCeor3Aq4o3xr0zRsSNRtNH1qLx1ON3DigRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709614424; a=rsa-sha256; cv=none; b=Xw64FRAauM3JxfOrszM3o99JOnRT1kqnns+8WcUZhOZpiELUHWDM22rAZDt977os1oVb32 7OOBvqtTYlkl8g45FLN6q6T0apI6HrrxRS1Qr/nQxa4peTsIKUkZ6z7T2q7+LSibSqijHu 24Z16Zn6QUafRMxSpmRxaJuo+owrkDqfDHtJwTzM16fqQ9G1UFGY5Re19p4tvuPjqWD1A7 8YWhUF3x0iKyQn4F+1bWlRHWhJph2w+uhAXcIHCzJb8/Zh1tdjlI9f/C7kK9pTbFLvU9b7 7KKHi+/GGiyiT7UKWTSh3ln48vkLN4viMpday9+opQyqqwXYG21OBN/ISD3eWQ== 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=1709614424; 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=4Hxxm2zoIUTHW0ipDkrUpScpFC8n4e9uv4ZW6qdYFnI=; b=IsvH6Q5S9oN+1Ow8KzMaKBmay7VH43RwZ3mDV2JbgKPS3lyDHqpB01oNmV8CHS6wAYpSda 2wh7u78B9ZH1AHDyMzDS/iggprxS3v+9ZWB/NPlECVuu5aln0vw02xFrw4eFYmMcKTWBUk r1ems3yDUbVD5K9S7uDSBXjcn3C3O1GvKAokismazngvcE4bccxnGJTIwJqF60PSi01UCA FhrynvbNHoWvmL1gL5dvyTOEiETjSQoVH6aRdOFN1Qwunrrlyzkd3Vm9wedbd0Ia16nzIB trCUOUZ1ULTqfU+S9545K6Q0lW+P+EJe3IQJguP5ovQn437pmv13+8iJm6yb8A== 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 4TpjrR73qPzs5R; Tue, 5 Mar 2024 04:53:43 +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 4254rhKl027407; Tue, 5 Mar 2024 04:53:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4254rhm7027404; Tue, 5 Mar 2024 04:53:43 GMT (envelope-from git) Date: Tue, 5 Mar 2024 04:53:43 GMT Message-Id: <202403050453.4254rhm7027404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 291079d0ebdd - main - pci_host_generic: Simplify generic_pcie_translate_resource List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 291079d0ebdd078840ccb27aaa5d286e03e2e7e6 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=291079d0ebdd078840ccb27aaa5d286e03e2e7e6 commit 291079d0ebdd078840ccb27aaa5d286e03e2e7e6 Author: John Baldwin AuthorDate: 2024-03-05 04:53:21 +0000 Commit: John Baldwin CommitDate: 2024-03-05 04:53:21 +0000 pci_host_generic: Simplify generic_pcie_translate_resource Inline generic_pcie_translate_resource_common into its sole caller. No functional change. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D44206 --- sys/dev/pci/pci_host_generic.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 0f85e23eb028..da49edcf91f5 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -504,8 +504,8 @@ generic_pcie_containing_range(device_t dev, int type, rman_res_t start, } static int -generic_pcie_translate_resource_common(device_t dev, int type, rman_res_t start, - rman_res_t end, rman_res_t *new_start, rman_res_t *new_end) +generic_pcie_translate_resource(device_t dev, int type, rman_res_t start, + rman_res_t *new_start) { struct pcie_range *range; @@ -513,34 +513,20 @@ generic_pcie_translate_resource_common(device_t dev, int type, rman_res_t start, switch (type) { case SYS_RES_IOPORT: case SYS_RES_MEMORY: - range = generic_pcie_containing_range(dev, type, start, end); + range = generic_pcie_containing_range(dev, type, start, start); if (range == NULL) return (ENOENT); - if (range != NULL) { - *new_start = start - range->pci_base + range->phys_base; - *new_end = end - range->pci_base + range->phys_base; - } + *new_start = start - range->pci_base + range->phys_base; break; default: /* No translation for non-memory types */ *new_start = start; - *new_end = end; break; } return (0); } -static int -generic_pcie_translate_resource(device_t bus, int type, - rman_res_t start, rman_res_t *newstart) -{ - rman_res_t newend; /* unused */ - - return (generic_pcie_translate_resource_common( - bus, type, start, start, newstart, &newend)); -} - struct resource * pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)