From nobody Wed Mar 13 22:13:37 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 4Tw4Xd6z0cz5DXS3; Wed, 13 Mar 2024 22:13:37 +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 4Tw4Xd5YfZz4qjT; Wed, 13 Mar 2024 22:13:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710368017; 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=jbDf+XpzLAMyv+Vta6VEJFIrS6EnH5QjxGxhG3C3Bok=; b=NElqmw0TsvZ9XBhEqDAuXRvsbeAJq9ShbJ9YotCB1EkOpbZ0Ax2KXW2bSZ0mtEesUI6Cip 5CsForN84i4h0YVauUS+dcAzyCb/QIzlq/YKl7o1pomq5uLiF1k2d94fPBbaD0kQ/s+AZI HP0RumsLMc+5nlonCdzPY0DHvYT5BKb8F+aG5MAExrPZc9iwla88tgmwRETSMe2iJProfE LHOcgiwwErRpSLgchRcY+DEuhyc5nsfL/hD3AcQYp/Uyw8mbm86CEOiG4+SzDCi1IYnaC7 PaI54RXoL27tC7P1tezPg3Ws3aMphz+iY3MTBQMF3IoY5ouZOtloXkmgKTo18g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1710368017; a=rsa-sha256; cv=none; b=gc9GPNvFomZPZgsSIdvMuj7TjlOrCumyrhGWGNFchPd1+ndLggAJSUz9pbFVEiQKgNdNFf RvnVDnvxZ7KexC+AG5bRdKmo9VBb07Dk0hJRp/TxCkMFvAbCa3+29xId4ecsKldIyYhS0a GOlUkdDGIK3OBT57PRYwDHeUtl1MMjQ+oBZh0bnqYzMlKi2I7iomYf8if/vXX/IKmeOQCD aTwgYsVv/5kmRabfFxZHmxb2FjFCuzRo/Opy9a1rq72LXaWY0JXYizQLdl9fm7wT9PYe0C pj+lZuu33pqxJHcQ19uV8EryyFpmw30qwq9cLb2BGIfwakHxKURA1ZW/oZBIgA== 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=1710368017; 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=jbDf+XpzLAMyv+Vta6VEJFIrS6EnH5QjxGxhG3C3Bok=; b=wnLQ9cLKTtbpYydDfbl4OPtNn2yW2ARxTN5RVTvKBhUybex9Q1ZArNsEt9GlPX2aeyqOsN 74rXiRqbbEu+KjePU09ZPplYfnvFlH2HiC0xwYR1o7/ZHjqeXNrto2xiarO0GD1wq3aaRx jow2sK9gLjpz0gAaanL8ih/LutjP11pyYvGGAJKRFDlXrVywUS5voJHdj9DsiLoTAY81XL JPDZWodFpiM1Kw2WuSz1sPUaVWwNs2iKq8L+0Gv13gH2rPq/3C1lQ1pYgVDYq9AmyP/Lnd HYakCvETq9quFDFpYttRl+/N43KlO7Jco/tZUQXhfK5VTRqJ3Y9om/P+tfa20Q== 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 4Tw4Xd5B95z11l5; Wed, 13 Mar 2024 22:13:37 +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 42DMDbOj074942; Wed, 13 Mar 2024 22:13:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42DMDbnX074939; Wed, 13 Mar 2024 22:13:37 GMT (envelope-from git) Date: Wed, 13 Mar 2024 22:13:37 GMT Message-Id: <202403132213.42DMDbnX074939@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: 3351964c5e5d - main - bhnd: Use rman_get_type in bhndb_find_resource_limits 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/main X-Git-Reftype: branch X-Git-Commit: 3351964c5e5d29ef93b3f26b7fc31a4972aa9af7 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3351964c5e5d29ef93b3f26b7fc31a4972aa9af7 commit 3351964c5e5d29ef93b3f26b7fc31a4972aa9af7 Author: John Baldwin AuthorDate: 2024-03-13 22:05:53 +0000 Commit: John Baldwin CommitDate: 2024-03-13 22:05:53 +0000 bhnd: Use rman_get_type in bhndb_find_resource_limits Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44126 --- sys/dev/bhnd/bhndb/bhndb.c | 2 +- sys/dev/bhnd/bhndb/bhndb_private.h | 2 +- sys/dev/bhnd/bhndb/bhndb_subr.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/bhnd/bhndb/bhndb.c b/sys/dev/bhnd/bhndb/bhndb.c index 978ad9c3e62b..ea5230bf459b 100644 --- a/sys/dev/bhnd/bhndb/bhndb.c +++ b/sys/dev/bhnd/bhndb/bhndb.c @@ -1113,7 +1113,7 @@ bhndb_adjust_resource(device_t dev, device_t child, int type, goto done; /* Otherwise, the range is limited by the bridged resource mapping */ - error = bhndb_find_resource_limits(sc->bus_res, type, r, &mstart, + error = bhndb_find_resource_limits(sc->bus_res, r, &mstart, &mend); if (error) goto done; diff --git a/sys/dev/bhnd/bhndb/bhndb_private.h b/sys/dev/bhnd/bhndb/bhndb_private.h index 851cbe82d3a7..7b56f0b05c84 100644 --- a/sys/dev/bhnd/bhndb/bhndb_private.h +++ b/sys/dev/bhnd/bhndb/bhndb_private.h @@ -73,7 +73,7 @@ int bhndb_add_resource_region( const struct bhndb_regwin *static_regwin); int bhndb_find_resource_limits( - struct bhndb_resources *br, int type, + struct bhndb_resources *br, struct resource *r, rman_res_t *start, rman_res_t *end); diff --git a/sys/dev/bhnd/bhndb/bhndb_subr.c b/sys/dev/bhnd/bhndb/bhndb_subr.c index f5253b3ecaca..df8f39048201 100644 --- a/sys/dev/bhnd/bhndb/bhndb_subr.c +++ b/sys/dev/bhnd/bhndb/bhndb_subr.c @@ -987,7 +987,6 @@ bhndb_find_intr_handler(struct bhndb_resources *br, void *cookiep) * returned. * * @param br The resource state to search. - * @param type The resource type (see SYS_RES_*). * @param r The resource to search for in @p br. * @param[out] start On success, the minimum supported start address. * @param[out] end On success, the maximum supported end address. @@ -996,14 +995,14 @@ bhndb_find_intr_handler(struct bhndb_resources *br, void *cookiep) * @retval ENOENT no active mapping found for @p r of @p type */ int -bhndb_find_resource_limits(struct bhndb_resources *br, int type, +bhndb_find_resource_limits(struct bhndb_resources *br, struct resource *r, rman_res_t *start, rman_res_t *end) { struct bhndb_dw_alloc *dynamic; struct bhndb_region *sregion; struct bhndb_intr_handler *ih; - switch (type) { + switch (rman_get_type(r)) { case SYS_RES_IRQ: /* Is this one of ours? */ STAILQ_FOREACH(ih, &br->bus_intrs, ih_link) { @@ -1042,7 +1041,8 @@ bhndb_find_resource_limits(struct bhndb_resources *br, int type, } default: - device_printf(br->dev, "unknown resource type: %d\n", type); + device_printf(br->dev, "unknown resource type: %d\n", + rman_get_type(r)); return (ENOENT); } }