From nobody Thu Feb 27 14:17:20 2025 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 4Z3YM46yywz5qG9v; Thu, 27 Feb 2025 14:17:20 +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 4Z3YM46Pjgz3xHN; Thu, 27 Feb 2025 14:17:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665840; 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=yXNLwxipWw3Fl1j4eeSPRJMLkovSKlcdRb7CD9WDhsw=; b=Uaekajc/WAjnGJh+K0msjlqhB/VgrBQZUe07t8odz3c/pdd/Op1oIHwX4YL3gXfrkKfDFR 2zoD5Xv93hLYWWqg4kh8w1TRWixtc0Xm19M7m7aT1kPUFS6KoTTGlc7jAlXw59gjCnoz6a 7dmxQjbIs0nSNdoyYGQYKj5ltOYr12ZEBTvv6PVFLhLOWtFGfEbN0yerrYGjJPvhjyYxPw f58mLniS46R1MJKyJgCkB8+DGV6L5uuxur6EpoXr+MU0wn1jYbrvuGgLgzeXR3aYEX0OwA g2eA2yRdU6HzDpSvXyK4amNcGJCHaV4o5L86+z8TOKNptU5F92mr5umrOW6Xtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665840; a=rsa-sha256; cv=none; b=uN2Oilkn8iFjdUU5XnJDK1ZaDIbBFPIgqTT1JI8OweDKF1zTiI5Q256gpp4tpdtJgTfEfS k23JX8yM9l0mMAwpOZhlllsiTv6iFrbp2hkKbN/Zfl195bGxNEVI6mN+2Lbx54/v09bGdf d9tyV7cthjCaXF+7zRHUiSZMd8JbAIN4dvHRQSXfxKTtopk6+TBgGtFvXB2LgFX1ISzoZ5 glieZqe8nPFvNUcNPeakiA4ciiWUyv3lRL8A+DIanfmIXtucpU1MaiGklTT+8rYnEnB5BL T+Ft0mL1qMzV+7a3GXoFEtHBuh2xwEHVVNRgalBeg+pxxCl1s8TC3pxJSwGFIg== 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=1740665840; 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=yXNLwxipWw3Fl1j4eeSPRJMLkovSKlcdRb7CD9WDhsw=; b=uJZYShG/O9TaSoeMQ4ClkydQb8yGTNNMTvt/55Ymx9owNuCi53KHaF67dx+eKOYFFJ4f1S 0TZkfiO2p703oxFH0wGoALuIPkI7gGqdGbWY8O8wkgQPhMp7OENCFwvlQyOcqnsikbDYrb 6U9Qun3LamM5Nr03ycw96EM8vuyf8puPIVZ6k50I3akJ4Jybb6BWs7vyNvfejBv+U0+aRs I40UY7d2Oz4gPyPhBuCIfcXphi1chautBdn24a6fznooCnFuLdMpY5p8BBFHdsQLNB9vCW m43j7MJoeBVAoBGxNYxdc7H+F7qd+4UVmB5djPF1eEzKXnZ2P72WKNwE5OeyOA== 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 4Z3YM45sTDzmqV; Thu, 27 Feb 2025 14:17:20 +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 51REHKu7017189; Thu, 27 Feb 2025 14:17:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHKNS017186; Thu, 27 Feb 2025 14:17:20 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:20 GMT Message-Id: <202502271417.51REHKNS017186@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: 07b5d67777a7 - stable/14 - acpi: Use rman_get_type in acpi_is_resource_managed 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 07b5d67777a73867dddc2be850c367f209a12f37 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=07b5d67777a73867dddc2be850c367f209a12f37 commit 07b5d67777a73867dddc2be850c367f209a12f37 Author: John Baldwin AuthorDate: 2024-03-13 22:05:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 acpi: Use rman_get_type in acpi_is_resource_managed Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44125 (cherry picked from commit 0ecee1602e195933a39da65d34440399129e19fb) --- sys/dev/acpica/acpi.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index ee2494debae7..de6520331644 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1554,11 +1554,11 @@ acpi_alloc_resource(device_t bus, device_t child, int type, int *rid, } static bool -acpi_is_resource_managed(device_t bus, int type, struct resource *r) +acpi_is_resource_managed(device_t bus, struct resource *r) { struct rman *rm; - rm = acpi_get_rman(bus, type, 0); + rm = acpi_get_rman(bus, rman_get_type(r), rman_get_flags(r)); if (rm == NULL) return (false); return (rman_is_region_manager(r, rm)); @@ -1570,7 +1570,7 @@ acpi_managed_resource(device_t bus, int type, struct resource *r) struct acpi_softc *sc = device_get_softc(bus); struct resource_list_entry *rle; - KASSERT(acpi_is_resource_managed(bus, type, r), + KASSERT(acpi_is_resource_managed(bus, r), ("resource %p is not suballocated", r)); STAILQ_FOREACH(rle, &sc->sysres_rl, link) { @@ -1588,7 +1588,7 @@ acpi_adjust_resource(device_t bus, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end) { - if (acpi_is_resource_managed(bus, type, r)) + if (acpi_is_resource_managed(bus, r)) return (rman_adjust_resource(r, start, end)); return (bus_generic_adjust_resource(bus, child, type, r, start, end)); } @@ -1601,7 +1601,7 @@ acpi_release_resource(device_t bus, device_t child, int type, int rid, * If this resource belongs to one of our internal managers, * deactivate it and release it to the local pool. */ - if (acpi_is_resource_managed(bus, type, r)) + if (acpi_is_resource_managed(bus, r)) return (bus_generic_rman_release_resource(bus, child, type, rid, r)); return (bus_generic_rl_release_resource(bus, child, type, rid, r)); @@ -1627,7 +1627,7 @@ static int acpi_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { - if (acpi_is_resource_managed(bus, type, r)) + if (acpi_is_resource_managed(bus, r)) return (bus_generic_rman_activate_resource(bus, child, type, rid, r)); return (bus_generic_activate_resource(bus, child, type, rid, r)); @@ -1637,7 +1637,7 @@ static int acpi_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { - if (acpi_is_resource_managed(bus, type, r)) + if (acpi_is_resource_managed(bus, r)) return (bus_generic_rman_deactivate_resource(bus, child, type, rid, r)); return (bus_generic_deactivate_resource(bus, child, type, rid, r)); @@ -1652,7 +1652,7 @@ acpi_map_resource(device_t bus, device_t child, int type, struct resource *r, rman_res_t length, start; int error; - if (!acpi_is_resource_managed(bus, type, r)) + if (!acpi_is_resource_managed(bus, r)) return (bus_generic_map_resource(bus, child, type, r, argsp, map)); @@ -1678,7 +1678,7 @@ static int acpi_unmap_resource(device_t bus, device_t child, int type, struct resource *r, struct resource_map *map) { - if (acpi_is_resource_managed(bus, type, r)) { + if (acpi_is_resource_managed(bus, r)) { r = acpi_managed_resource(bus, type, r); if (r == NULL) return (ENOENT);