From nobody Tue Dec 9 20:12:39 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 4dQqlW4ZSrz6JkY6 for ; Tue, 09 Dec 2025 20:12:39 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dQqlW14Bvz3wRP for ; Tue, 09 Dec 2025 20:12:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765311159; 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=uCOriMitX7OsYcz+6+jHiPQ8oQnKZsmLm8XbKXwKvM0=; b=iQVKOocBq5XBL8qW8sLzQRVxPbw8GvYYtr1txiPNZF+N9i8ifLcfQakup6qeVz+GG/iYDg ++GYRbuVJdcvKF56RpryEK5oaXxvX3m0mGhBBfVyF0Tv75eW/stg5s/5Yw44BHYNrVoiT9 eTQR5gZD111JhjjUupCI4LP7XrBRrygId2WIJSFd7IVNktzFiIJXJTYniDxf6RUbm661MX gBAQNLc2xPVwN92mPRvGJqCDuXu6BAFPpYJYmd5sb+UqorjNxjcafcjc8qJf53gAoqHDnC tO2rJF9Ip4LlrnuQH/SmqCPpnZFpIXq9YPLKHRxjHXTR3Ho0y3K4Yvd8fCfqjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765311159; 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=uCOriMitX7OsYcz+6+jHiPQ8oQnKZsmLm8XbKXwKvM0=; b=aq6ZNdoO2ZSTUu6nWeuFiyld1LruAG6ieYyL5/sL0Cw8qdIaL3fPVkMhJ7YmztwWLrJQME KTHm5rv244+mDGqh4JJ+2dMI8KHzwOnwWR7kwT87pRDtz0pMcvTjLIfLi/uta4VOHIhXsg vgFiZkKaZI3BPKo0iBBGcluxoVyfvwLz8swkz0uP23Xwfp7BWndeqaQ62IuRPY1YbQEGHg Qdl/S6DDkuGirUolyzpnZHk6CSdyvcXK9zBgrnEj9gREgwRQDX68nnxLRpQYzzHzAa6g0J brligpS74O2wpHiMy5cUy2eoMs0n9Qtmsk79osrUbmxyrxltDPd0EE3b6ibXeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765311159; a=rsa-sha256; cv=none; b=Ky8hOvtreZFbjd237uKWv7DgsSJlK0NE3eGdxvsAEw93Ncn1ZXMducyj5RDD+7PgfE6Vc4 +FKUg5UhoXepAsqs+xtaQlRUb2HF5ZsvVUTdBPYKeYJ2iZqMQnhz9ZP0FxkmUuFfHwRf+9 y2IB6Ph+OexXz+DmWxTIUjv1fsgqJKeyHL7dmPnTegRGfvZLa195/GVrE+SA7TJHD7MABe bQunPkCKGyOV43+wjDKxJfBACM3VYYtlUzPOU6SPa+aXYMw5bdykPgShLiWLuTHX0Jt+k8 2InYUaWsgJU2XacCTPEB5htvQyHf30pUDRRFqPE9E4aQoWulcO2UH14n6j79VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dQqlW0cyVz1CY0 for ; Tue, 09 Dec 2025 20:12:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2f4de by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 09 Dec 2025 20:12:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 1033312267d6 - main - bhnd_bus_alloc_resource*: Pass rid by value 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/main X-Git-Reftype: branch X-Git-Commit: 1033312267d66496c661feefe6c14a86d7e4b95e Auto-Submitted: auto-generated Date: Tue, 09 Dec 2025 20:12:39 +0000 Message-Id: <693882b7.2f4de.5366b7dd@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1033312267d66496c661feefe6c14a86d7e4b95e commit 1033312267d66496c661feefe6c14a86d7e4b95e Author: John Baldwin AuthorDate: 2025-12-09 20:03:25 +0000 Commit: John Baldwin CommitDate: 2025-12-09 20:03:25 +0000 bhnd_bus_alloc_resource*: Pass rid by value Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53409 --- sys/dev/bhnd/bcma/bcma_subr.c | 2 +- sys/dev/bhnd/bhnd.h | 6 +++--- sys/dev/bhnd/bhnd_bus_if.m | 2 +- sys/dev/bhnd/bhnd_erom.c | 2 +- sys/dev/bhnd/bhnd_subr.c | 8 ++++---- sys/dev/bhnd/cores/chipc/chipc_gpio.c | 2 +- sys/dev/bhnd/cores/chipc/chipc_subr.c | 2 +- sys/dev/bhnd/cores/pci/bhnd_pci.c | 2 +- sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c | 2 +- sys/dev/bhnd/cores/pmu/bhnd_pmu_core.c | 2 +- sys/dev/bhnd/nvram/bhnd_sprom.c | 2 +- sys/dev/bhnd/siba/siba.c | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/sys/dev/bhnd/bcma/bcma_subr.c b/sys/dev/bhnd/bcma/bcma_subr.c index d10501c70564..9e442ce911d4 100644 --- a/sys/dev/bhnd/bcma/bcma_subr.c +++ b/sys/dev/bhnd/bcma/bcma_subr.c @@ -239,7 +239,7 @@ bcma_dinfo_init_agent(device_t bus, device_t child, struct bcma_devinfo *dinfo) dinfo->rid_agent = BCMA_AGENT_RID(dinfo); dinfo->res_agent = BHND_BUS_ALLOC_RESOURCE(bus, bus, SYS_RES_MEMORY, - &dinfo->rid_agent, r_start, r_end, r_count, RF_ACTIVE|RF_SHAREABLE); + dinfo->rid_agent, r_start, r_end, r_count, RF_ACTIVE|RF_SHAREABLE); if (dinfo->res_agent == NULL) { device_printf(bus, "failed allocating agent register block for " "core %u\n", BCMA_DINFO_COREIDX(dinfo)); diff --git a/sys/dev/bhnd/bhnd.h b/sys/dev/bhnd/bhnd.h index c21cca0f48dd..da1686f4d6c9 100644 --- a/sys/dev/bhnd/bhnd.h +++ b/sys/dev/bhnd/bhnd.h @@ -617,7 +617,7 @@ int bhnd_bus_generic_read_board_info(device_t dev, device_t child, struct bhnd_board_info *info); struct bhnd_resource *bhnd_bus_generic_alloc_resource (device_t dev, - device_t child, int type, int *rid, + device_t child, int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); int bhnd_bus_generic_release_resource (device_t dev, @@ -1292,7 +1292,7 @@ bhnd_nvram_getvar(device_t dev, const char *name, void *buf, size_t *len, * @retval resource The allocated resource. */ static inline struct bhnd_resource * -bhnd_alloc_resource(device_t dev, int type, int *rid, rman_res_t start, +bhnd_alloc_resource(device_t dev, int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { return BHND_BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, type, rid, @@ -1314,7 +1314,7 @@ bhnd_alloc_resource(device_t dev, int type, int *rid, rman_res_t start, * @retval resource The allocated resource. */ static inline struct bhnd_resource * -bhnd_alloc_resource_any(device_t dev, int type, int *rid, u_int flags) +bhnd_alloc_resource_any(device_t dev, int type, int rid, u_int flags) { return bhnd_alloc_resource(dev, type, rid, 0, ~0, 1, flags); } diff --git a/sys/dev/bhnd/bhnd_bus_if.m b/sys/dev/bhnd/bhnd_bus_if.m index adb2af9c4d85..62c34404e87f 100644 --- a/sys/dev/bhnd/bhnd_bus_if.m +++ b/sys/dev/bhnd/bhnd_bus_if.m @@ -923,7 +923,7 @@ METHOD struct bhnd_resource * alloc_resource { device_t dev; device_t child; int type; - int *rid; + int rid; rman_res_t start; rman_res_t end; rman_res_t count; diff --git a/sys/dev/bhnd/bhnd_erom.c b/sys/dev/bhnd/bhnd_erom.c index 6cb98dec9858..2c4af61438fe 100644 --- a/sys/dev/bhnd/bhnd_erom.c +++ b/sys/dev/bhnd/bhnd_erom.c @@ -429,7 +429,7 @@ bhnd_erom_iores_map(struct bhnd_erom_io *eio, bhnd_addr_t addr, /* Try to allocate the new mapping */ iores->mapped_rid = iores->owner_rid; iores->mapped = bhnd_alloc_resource(iores->owner, SYS_RES_MEMORY, - &iores->mapped_rid, addr, addr+size-1, size, + iores->mapped_rid, addr, addr+size-1, size, RF_ACTIVE|RF_SHAREABLE); if (iores->mapped == NULL) { iores->mapped_rid = -1; diff --git a/sys/dev/bhnd/bhnd_subr.c b/sys/dev/bhnd/bhnd_subr.c index ac4f69db8cae..299388d51626 100644 --- a/sys/dev/bhnd/bhnd_subr.c +++ b/sys/dev/bhnd/bhnd_subr.c @@ -1015,7 +1015,7 @@ bhnd_alloc_resources(device_t dev, struct resource_spec *rs, res[i] = NULL; for (u_int i = 0; rs[i].type != -1; i++) { - res[i] = bhnd_alloc_resource_any(dev, rs[i].type, &rs[i].rid, + res[i] = bhnd_alloc_resource_any(dev, rs[i].type, rs[i].rid, rs[i].flags); /* Clean up all allocations on failure */ @@ -2190,7 +2190,7 @@ bhnd_bus_generic_get_nvram_var(device_t dev, device_t child, const char *name, */ struct bhnd_resource * bhnd_bus_generic_alloc_resource(device_t dev, device_t child, int type, - int *rid, rman_res_t start, rman_res_t end, rman_res_t count, + int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct bhnd_resource *br; @@ -2201,7 +2201,7 @@ bhnd_bus_generic_alloc_resource(device_t dev, device_t child, int type, res = NULL; /* Allocate the real bus resource (without activating it) */ - res = BUS_ALLOC_RESOURCE(dev, child, type, *rid, start, end, count, + res = BUS_ALLOC_RESOURCE(dev, child, type, rid, start, end, count, (flags & ~RF_ACTIVE)); if (res == NULL) return (NULL); @@ -2216,7 +2216,7 @@ bhnd_bus_generic_alloc_resource(device_t dev, device_t child, int type, /* Attempt activation */ if (flags & RF_ACTIVE) { - error = BHND_BUS_ACTIVATE_RESOURCE(dev, child, type, *rid, br); + error = BHND_BUS_ACTIVATE_RESOURCE(dev, child, type, rid, br); if (error) goto failed; } diff --git a/sys/dev/bhnd/cores/chipc/chipc_gpio.c b/sys/dev/bhnd/cores/chipc/chipc_gpio.c index 429de0fc1fd8..8e4445155f7b 100644 --- a/sys/dev/bhnd/cores/chipc/chipc_gpio.c +++ b/sys/dev/bhnd/cores/chipc/chipc_gpio.c @@ -139,7 +139,7 @@ chipc_gpio_attach(device_t dev) CC_GPIO_LOCK_INIT(sc); sc->mem_rid = 0; - sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, + sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, sc->mem_rid, RF_ACTIVE|RF_SHAREABLE); if (sc->mem_res == NULL) { device_printf(dev, "failed to allocate chipcommon registers\n"); diff --git a/sys/dev/bhnd/cores/chipc/chipc_subr.c b/sys/dev/bhnd/cores/chipc/chipc_subr.c index 1137d3ab67cc..bb5764af1ef3 100644 --- a/sys/dev/bhnd/cores/chipc/chipc_subr.c +++ b/sys/dev/bhnd/cores/chipc/chipc_subr.c @@ -469,7 +469,7 @@ chipc_retain_region(struct chipc_softc *sc, struct chipc_region *cr, int flags) /* Allocate resource */ cr->cr_res = bhnd_alloc_resource(sc->dev, - SYS_RES_MEMORY, &cr->cr_res_rid, cr->cr_addr, + SYS_RES_MEMORY, cr->cr_res_rid, cr->cr_addr, cr->cr_end, cr->cr_count, RF_SHAREABLE); if (cr->cr_res == NULL) { CHIPC_UNLOCK(sc); diff --git a/sys/dev/bhnd/cores/pci/bhnd_pci.c b/sys/dev/bhnd/cores/pci/bhnd_pci.c index 45775916e5cf..b8af7dd29fc5 100644 --- a/sys/dev/bhnd/cores/pci/bhnd_pci.c +++ b/sys/dev/bhnd/cores/pci/bhnd_pci.c @@ -132,7 +132,7 @@ bhnd_pci_generic_attach(device_t dev) sizeof(bhnd_pci_devs[0])); /* Allocate bus resources */ - sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, + sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, sc->mem_rid, RF_ACTIVE); if (sc->mem_res == NULL) return (ENXIO); diff --git a/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c b/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c index 15a93f9e0b93..01881aca3876 100644 --- a/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c +++ b/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c @@ -96,7 +96,7 @@ bhnd_pcie2_generic_attach(device_t dev) sizeof(bhnd_pcie2_devs[0])); /* Allocate bus resources */ - sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, + sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, sc->mem_rid, RF_ACTIVE); if (sc->mem_res == NULL) return (ENXIO); diff --git a/sys/dev/bhnd/cores/pmu/bhnd_pmu_core.c b/sys/dev/bhnd/cores/pmu/bhnd_pmu_core.c index d324cb8c0924..e4bb34cab5a8 100644 --- a/sys/dev/bhnd/cores/pmu/bhnd_pmu_core.c +++ b/sys/dev/bhnd/cores/pmu/bhnd_pmu_core.c @@ -87,7 +87,7 @@ bhnd_pmu_core_attach(device_t dev) /* Allocate register block */ rid = 0; - res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, rid, RF_ACTIVE); if (res == NULL) { device_printf(dev, "failed to allocate resources\n"); return (ENXIO); diff --git a/sys/dev/bhnd/nvram/bhnd_sprom.c b/sys/dev/bhnd/nvram/bhnd_sprom.c index 32bc882f6df0..9975b4525cdf 100644 --- a/sys/dev/bhnd/nvram/bhnd_sprom.c +++ b/sys/dev/bhnd/nvram/bhnd_sprom.c @@ -108,7 +108,7 @@ bhnd_sprom_attach(device_t dev, bus_size_t offset) /* Allocate SPROM resource */ rid = 0; - r = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + r = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, rid, RF_ACTIVE); if (r == NULL) { device_printf(dev, "failed to allocate resources\n"); return (ENXIO); diff --git a/sys/dev/bhnd/siba/siba.c b/sys/dev/bhnd/siba/siba.c index a8e83f843506..c4abf8b75765 100644 --- a/sys/dev/bhnd/siba/siba.c +++ b/sys/dev/bhnd/siba/siba.c @@ -1220,7 +1220,7 @@ siba_map_cfg_resources(device_t dev, struct siba_devinfo *dinfo) /* Map the config resource for bus-level access */ dinfo->cfg_rid[i] = SIBA_CFG_RID(dinfo, i); dinfo->cfg_res[i] = BHND_BUS_ALLOC_RESOURCE(dev, dev, - SYS_RES_MEMORY, &dinfo->cfg_rid[i], r_start, r_end, + SYS_RES_MEMORY, dinfo->cfg_rid[i], r_start, r_end, r_count, RF_ACTIVE|RF_SHAREABLE); if (dinfo->cfg_res[i] == NULL) {