From nobody Tue May 21 23:56:24 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 4VkWYP00cZz5L6ql; Tue, 21 May 2024 23:56:25 +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 4VkWYN3H7sz4hyJ; Tue, 21 May 2024 23:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716335784; 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=V8izRIUi3gq4xb59TEBgIm57otsn3+dcmFSP5n7Qn64=; b=m8+s/Ql5/za1jnmuP034tzWMjS3QS3OIRb6emFWtopAqoMkoThyt/T1ubpYaqCWa79Cs3a cuaKh7jMk1JAe0wqHixqOBLzF9P2Pwnom9yq8wHf7CtX7XZmzmdhqne03JbVM549FEG4fb gGGOPLzq+ugCfBVBs6LDAb/F0zGPyvan3aR+uHE7VselZ/axCSvadv9IPOyDOZQ5M/CZeR 9kT1ik2vwbTUdodBte1Mxc55czqoQlcmQZgRmcuWXMNGFHENuTKOMDfiZ2wnGK9mhqw2D9 lm2ClwUvZTIF2Dz1zVQiAR+/HX6HgUcfAE2qtIUIl10A3BYd05ijS6US2U9H5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716335784; a=rsa-sha256; cv=none; b=Ol3d05ipv/FYAlcdgXnmS8M9aexsQDwj32bSIHGWawTFydQDUZTw5bQu7DwBch4PpkcE2s zpRbqNh4bBnOhdvrdMEQybm/g04uLXVCkJWUECksfDQiSBrdQubIS7LjxANxT/rasxuAiE cxVFuX9dshZNic6z3DyVpqMRH9+lL+mJs0lW2yQYwA9QiI2bs19ZCjgb90vd158rzq+XbZ nNjkadkkF01BwRYHq3VhmFGvz2qva8SSBGFp9LeYv3aw7V0vXhpwLXKiogyg5ksH/Ln78A ranac8j21ipc2x3O93RHQuDHVUhAHNk86CAKCC6o7RdIVprBS6MdXrlVHdNmzw== 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=1716335784; 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=V8izRIUi3gq4xb59TEBgIm57otsn3+dcmFSP5n7Qn64=; b=M/0kA/g7KEyWHhvmSrq30BVY8lENoRuWNDZ2GnrQhR3tFErXc6KyIahq4m45eCf0ne1mgO OBTdnd7q2pf2IqzJtD9QNVCN7bxGNE4QJi13tBKfvxcZYp64k4Ag2Z0c0W9/q26+wJzwGT pUf2DRTgcjFwAqKH/lUlHtLu47pwmqtWkzTRkk4HGm0AUSuSMND/1Q4uGPAF+/sXkREM6+ Ih6kCGlkcrcpZ0N0/vv5gD2Ac0TZvSiluBTrz1YQEKySnXEhSmZjJluYuAuFFwerzaMv4e 48aan3mdPOg6nCYTxSwtDknEY8fH5fDG33qckF0anXc2XqgRmpZ05okjfnkWTg== 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 4VkWYN2sYDzjKD; Tue, 21 May 2024 23:56:24 +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 44LNuOF1032312; Tue, 21 May 2024 23:56:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LNuOKl032309; Tue, 21 May 2024 23:56:24 GMT (envelope-from git) Date: Tue, 21 May 2024 23:56:24 GMT Message-Id: <202405212356.44LNuOKl032309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: cbcb9778dd95 - main - kern/rman: mark rman get functions as taking constants 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cbcb9778dd957adf28fac011c6d7b511ca80c469 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cbcb9778dd957adf28fac011c6d7b511ca80c469 commit cbcb9778dd957adf28fac011c6d7b511ca80c469 Author: Elliott Mitchell AuthorDate: 2024-05-10 16:13:39 +0000 Commit: Warner Losh CommitDate: 2024-05-21 23:52:29 +0000 kern/rman: mark rman get functions as taking constants The arguments are left completely unchanged by these functions. This allows passing constant pointers for verifying ownership, but not modifying the contents. Reviewed by: imp,jhb Pull Request: https://github.com/freebsd/freebsd-src/pull/1224 --- sys/kern/subr_rman.c | 26 +++++++++++++------------- sys/sys/rman.h | 26 +++++++++++++------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index 508152f74002..dbb09850d049 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -787,28 +787,28 @@ rman_make_alignment_flags(uint32_t size) } rman_res_t -rman_get_start(struct resource *r) +rman_get_start(const struct resource *r) { return (r->__r_i->r_start); } rman_res_t -rman_get_end(struct resource *r) +rman_get_end(const struct resource *r) { return (r->__r_i->r_end); } rman_res_t -rman_get_size(struct resource *r) +rman_get_size(const struct resource *r) { return (r->__r_i->r_end - r->__r_i->r_start + 1); } u_int -rman_get_flags(struct resource *r) +rman_get_flags(const struct resource *r) { return (r->__r_i->r_flags); @@ -822,7 +822,7 @@ rman_set_virtual(struct resource *r, void *v) } void * -rman_get_virtual(struct resource *r) +rman_get_virtual(const struct resource *r) { return (r->__r_i->r_virtual); @@ -836,7 +836,7 @@ rman_set_irq_cookie(struct resource *r, void *c) } void * -rman_get_irq_cookie(struct resource *r) +rman_get_irq_cookie(const struct resource *r) { return (r->__r_i->r_irq_cookie); @@ -850,7 +850,7 @@ rman_set_bustag(struct resource *r, bus_space_tag_t t) } bus_space_tag_t -rman_get_bustag(struct resource *r) +rman_get_bustag(const struct resource *r) { return (r->r_bustag); @@ -864,7 +864,7 @@ rman_set_bushandle(struct resource *r, bus_space_handle_t h) } bus_space_handle_t -rman_get_bushandle(struct resource *r) +rman_get_bushandle(const struct resource *r) { return (r->r_bushandle); @@ -882,7 +882,7 @@ rman_set_mapping(struct resource *r, struct resource_map *map) } void -rman_get_mapping(struct resource *r, struct resource_map *map) +rman_get_mapping(const struct resource *r, struct resource_map *map) { map->r_bustag = rman_get_bustag(r); @@ -899,7 +899,7 @@ rman_set_rid(struct resource *r, int rid) } int -rman_get_rid(struct resource *r) +rman_get_rid(const struct resource *r) { return (r->__r_i->r_rid); @@ -912,7 +912,7 @@ rman_set_type(struct resource *r, int type) } int -rman_get_type(struct resource *r) +rman_get_type(const struct resource *r) { return (r->__r_i->r_type); } @@ -925,14 +925,14 @@ rman_set_device(struct resource *r, device_t dev) } device_t -rman_get_device(struct resource *r) +rman_get_device(const struct resource *r) { return (r->__r_i->r_dev); } int -rman_is_region_manager(struct resource *r, struct rman *rm) +rman_is_region_manager(const struct resource *r, const struct rman *rm) { return (r->__r_i->r_rm == rm); diff --git a/sys/sys/rman.h b/sys/sys/rman.h index 70655339183b..323da4a62201 100644 --- a/sys/sys/rman.h +++ b/sys/sys/rman.h @@ -124,18 +124,18 @@ TAILQ_HEAD(rman_head, rman); int rman_activate_resource(struct resource *r); int rman_adjust_resource(struct resource *r, rman_res_t start, rman_res_t end); int rman_first_free_region(struct rman *rm, rman_res_t *start, rman_res_t *end); -bus_space_handle_t rman_get_bushandle(struct resource *); -bus_space_tag_t rman_get_bustag(struct resource *); -rman_res_t rman_get_end(struct resource *); -device_t rman_get_device(struct resource *); -u_int rman_get_flags(struct resource *); -void *rman_get_irq_cookie(struct resource *); -void rman_get_mapping(struct resource *, struct resource_map *); -int rman_get_rid(struct resource *); -rman_res_t rman_get_size(struct resource *); -rman_res_t rman_get_start(struct resource *); -int rman_get_type(struct resource *); -void *rman_get_virtual(struct resource *); +bus_space_handle_t rman_get_bushandle(const struct resource *); +bus_space_tag_t rman_get_bustag(const struct resource *); +rman_res_t rman_get_end(const struct resource *); +device_t rman_get_device(const struct resource *); +u_int rman_get_flags(const struct resource *); +void *rman_get_irq_cookie(const struct resource *); +void rman_get_mapping(const struct resource *, struct resource_map *); +int rman_get_rid(const struct resource *); +rman_res_t rman_get_size(const struct resource *); +rman_res_t rman_get_start(const struct resource *); +int rman_get_type(const struct resource *); +void *rman_get_virtual(const struct resource *); int rman_deactivate_resource(struct resource *r); int rman_fini(struct rman *rm); int rman_init(struct rman *rm); @@ -143,7 +143,7 @@ int rman_init_from_resource(struct rman *rm, struct resource *r); int rman_last_free_region(struct rman *rm, rman_res_t *start, rman_res_t *end); uint32_t rman_make_alignment_flags(uint32_t size); int rman_manage_region(struct rman *rm, rman_res_t start, rman_res_t end); -int rman_is_region_manager(struct resource *r, struct rman *rm); +int rman_is_region_manager(const struct resource *r, const struct rman *rm); int rman_release_resource(struct resource *r); struct resource *rman_reserve_resource(struct rman *rm, rman_res_t start, rman_res_t end, rman_res_t count,