From nobody Fri Jun 14 07:20:04 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 4W0rJh4bwFz5Nb4S; Fri, 14 Jun 2024 07:20:04 +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 4W0rJh3s1nz54wK; Fri, 14 Jun 2024 07:20:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718349604; 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=yqwWq/rkBOJojdceA6PFXoUFEYYrnZMEiTdj9CgHmHc=; b=HhOhFLb8dQM6biOFFKcT43qWfm4ocB1IVYJtwdqrO/oNuLH02fxwhDt4vPf4ooj5p0+yoR RtbbEal5vJbmJk2Q+KbpmJ6o0qj6kKrCJdwwdgnVYYuJUHJHvzC88z7xYyvvgNWUb1fpE0 jc//O6FlTnaEVOKJeSK7Ojk45tN1vPWk5IZkd+JGjAwWUsRw/3vKItY3MpavqeVp9Wr9VT vmKxwuPgU9BIiw89Bi/qQ0CVL3yI8MUrENBjp2ktmJzOThHnKH+i/uv8w8vgqYXSHPk1dM 2An5U1VB2exKVQhRQC4kpm/sVWDCJaTq9vzFhrhyomaPxjjYQdTNo94zvjrUAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718349604; a=rsa-sha256; cv=none; b=rMIc1kjFNFWSkKndNoeYiWjISHPV2jnigvE7h5yv7sz6Yw4zYS+KzIAQ1B1V2KmLq6/ySd 6+OVYZXIBhWm9XYBNFMyrixE7DjLmSvgFg6zghTL+LQBE6+aVpAw76FGGn/ofv+kYZKAe5 iiVjK5insKJzTkxzEhBIb8uruRCm+DyN1KmROmmmnn1ckLN+jbgqx3kHU9Zhey++Epyv03 JOHB0krsqKIT4uhZ9JEMuDQPTNXppPzWUS/G0nmdYVImmcV0vJJncBj5quBUxya4DIIx/2 dgjRRW21GgNvR5EMeTGVRLMPKrMAXPgHUEuWKWd7D8xGszAJVon8Wkm20VyaPQ== 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=1718349604; 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=yqwWq/rkBOJojdceA6PFXoUFEYYrnZMEiTdj9CgHmHc=; b=obgODbx64U86OBdBJKBF7DojmBpRLuwKxU8NIxipGVQNDYe3OqjIYut5L34xPq9AgKKr/n oNU3c4xOwN4B/IBrLLvDa5hR1TFd3Edj4PlOSg/ves8V7JODCadcBkTzFDq0e1jzbqUDLQ P/t2fXRc2n92wnhDhkZZGw0XoyewIwHHyBq5VGyYguxAFCo1qhNxVpWVeXY67oLbvDeVlu noZZE6IW67t0XnraKO/9Lv61uqIQYx3zjM8kP8JciYCOlYq7fjJwGQdThBoJKCqTC5zEHA Mte6wu7g0YQ/2BlngyLt0eCcD4UnastqPYpNJkP5Gnf9hB8sd2jTWT80siavFw== 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 4W0rJh3L9Rz19l7; Fri, 14 Jun 2024 07:20:04 +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 45E7K4qk058064; Fri, 14 Jun 2024 07:20:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45E7K4aZ058059; Fri, 14 Jun 2024 07:20:04 GMT (envelope-from git) Date: Fri, 14 Jun 2024 07:20:04 GMT Message-Id: <202406140720.45E7K4aZ058059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 2a21cfe60fcf - main - pctrie: avoid typecast 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: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a21cfe60fcf8e49dad60a9a40d2fc9e62cda563 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=2a21cfe60fcf8e49dad60a9a40d2fc9e62cda563 commit 2a21cfe60fcf8e49dad60a9a40d2fc9e62cda563 Author: Doug Moore AuthorDate: 2024-06-14 07:19:03 +0000 Commit: Doug Moore CommitDate: 2024-06-14 07:19:03 +0000 pctrie: avoid typecast Have PCTRIE_RECLAIM_CALLBACK typecast one function pointer type to another, to relieve the writer of the call back function from having to cast its first argument from void* to member type. Reviewed by: rlibby Differential Revision: https://reviews.freebsd.org/D45586 --- sys/kern/subr_rangeset.c | 3 +-- sys/sys/pctrie.h | 3 ++- sys/vm/swap_pager.c | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/kern/subr_rangeset.c b/sys/kern/subr_rangeset.c index 94b77a449d22..ddb1839531ea 100644 --- a/sys/kern/subr_rangeset.c +++ b/sys/kern/subr_rangeset.c @@ -233,9 +233,8 @@ rangeset_remove(struct rangeset *rs, uint64_t start, uint64_t end) } static void -rangeset_remove_leaf(void *rv, void *rsv) +rangeset_remove_leaf(struct rs_el *r, void *rsv) { - struct rs_el *r = rv; struct rangeset *rs = rsv; rs->rs_free_data(rs->rs_data_ctx, r); diff --git a/sys/sys/pctrie.h b/sys/sys/pctrie.h index 4e1d8c7f8617..d06b533a54b7 100644 --- a/sys/sys/pctrie.h +++ b/sys/sys/pctrie.h @@ -226,9 +226,10 @@ name##_PCTRIE_RECLAIM(struct pctrie *ptree) \ */ \ static __inline __unused void \ name##_PCTRIE_RECLAIM_CALLBACK(struct pctrie *ptree, \ - pctrie_cb_t callback, void *arg) \ + void (*typed_cb)(struct type *, void *), void *arg) \ { \ struct pctrie_node *freenode, *node; \ + pctrie_cb_t callback = (pctrie_cb_t)typed_cb; \ \ for (freenode = pctrie_reclaim_begin_cb(&node, ptree, \ callback, __offsetof(struct type, field), arg); \ diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index c339f70ddea1..455c39ab6fd7 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2220,9 +2220,8 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count, } static void -swp_pager_meta_free_block(void *sbv, void *rangev) +swp_pager_meta_free_block(struct swblk *sb, void *rangev) { - struct swblk *sb = sbv; struct page_range *range = rangev; for (int i = 0; i < SWAP_META_PAGES; i++) {