From nobody Wed Mar 13 22:13:36 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 4Tw4Xc6YXfz5DXPk; Wed, 13 Mar 2024 22:13:36 +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 4Tw4Xc4wLbz4qRR; Wed, 13 Mar 2024 22:13:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710368016; 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=olDJHTTgHzzKvRi7dwHFkViPgDqDBGbCwZOfWVvV3SQ=; b=upA2lVj0JpDUF+3VFS6ze2eau+1EHKhD5SbpWM2vOVaVz6Wk/A1Ynx6QNiUphekGPTBO8C IwFA43EXF6AJhBUDrI7Jz1X4zIzT1bYqzKMj2XHmOwiCy4iouOLjaxOFiyPgONH+/ALy0O QWaYicQSqV6RuPsX7Lg7GfHB6IDaBoWOUoPKXK5c9Wb9GlpFZigybl/0X7bE/QC+v7vbPd 1S9uZhNX5YOEI4Vi2KrhCUzurIPlqE97OY4ZpNstKfq2ddNKE2FxTe0TT8WKaAxuGVgsDc 58FUuv5wLntjK3N4+gooHY7Z34/1rVcMhBmJl9owP/4A1rM/B/Bdc6jFXGLdaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1710368016; a=rsa-sha256; cv=none; b=E4r2w6K5VMLKL315rMQrA2Ret7LENSvMlPY5gY6jcfYsXE+FWBMQ1rpbvfo1ioEdrLVvne 1JL+YX7HXreMNHuqzwhspiKxFR657y1+VuCyOuUie1GWz12ho8+09KzJD2bFyRcIFhLhJf UdjueZPSldoVzt+AjDXaa/mOIcmzbW4rtc5dfIy3kiy2MH+7m5FQgFrfExgU5s944hePkL J/D0pJe51bHwn0Ne6/bfolTAKi7bNOBgcFpSjb317vEywETzqdlCJZyrq3edr5vxWPJ+W2 gIH9u07E+EQdR9RK26SIwUDxGuDLX1Cd1tYUvbwLd+JeWaelHIq/DeVPRWPRIw== 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=1710368016; 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=olDJHTTgHzzKvRi7dwHFkViPgDqDBGbCwZOfWVvV3SQ=; b=ghEmgACtuRYx4gWGb/VfYIYZ991GkoyXJI5zOBckygxMgpK2Hcdo86kZhX0vpjnm5YdTH9 sI+vqifwsrP3lvGvl/O+wgp9jm8QJvO1ckkmIWkd6NTcqpCf4SB3JMFsNtySQprRq8O0+y zCMrBUgzL14o3XQQxPbB6xLsAoX+cvnU18EXJaom6RirP/euj5gHGKJKzjJrUhMMbH6wxo SQu3a8W69wpdVG+DS3PL6vjQwhJyd+mahsNtv/AsklluCq8wj6LIK1oxdtb4qEqn6rCbkm NgkD77/YOvhZaKgc+B+Zt2YO3CWyF9DfovO6D1csB6Gf1wKh1ke+P13Ug0O75A== 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 4Tw4Xc4Djsz11nK; Wed, 13 Mar 2024 22:13:36 +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 42DMDaOJ074894; Wed, 13 Mar 2024 22:13:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42DMDaKw074891; Wed, 13 Mar 2024 22:13:36 GMT (envelope-from git) Date: Wed, 13 Mar 2024 22:13:36 GMT Message-Id: <202403132213.42DMDaKw074891@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: 0ecee1602e19 - main - acpi: Use rman_get_type in acpi_is_resource_managed 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: 0ecee1602e195933a39da65d34440399129e19fb Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0ecee1602e195933a39da65d34440399129e19fb commit 0ecee1602e195933a39da65d34440399129e19fb Author: John Baldwin AuthorDate: 2024-03-13 22:05:53 +0000 Commit: John Baldwin CommitDate: 2024-03-13 22:05:53 +0000 acpi: Use rman_get_type in acpi_is_resource_managed Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44125 --- 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 defca923e36c..0ea9a32b1589 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1540,11 +1540,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)); @@ -1556,7 +1556,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) { @@ -1574,7 +1574,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)); } @@ -1587,7 +1587,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)); @@ -1613,7 +1613,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)); @@ -1623,7 +1623,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)); @@ -1638,7 +1638,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)); @@ -1664,7 +1664,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);