From nobody Fri Oct 25 17:38:22 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 4XZqkl1CRBz5Zyst; Fri, 25 Oct 2024 17:38:23 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XZqkl0Gdlz4SLD; Fri, 25 Oct 2024 17:38:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729877903; 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=/bsmPQaA3UMluJ/MYwhpkP/+mPHIa/7W/YZYq1W8FOQ=; b=hRYTRAbSO+hebhbHR0nySNxxWIyasW7Sq3owgMZhIAh05sskA7YuyzXege4w5RY1Rw8B/0 eohWist9FSklqA3pcelo7u69WkOv8N84A6tHmNIuE3Zb6HBXp/iEOIr6vLsyH2um0cPg00 O/7Jb+hYsrzN6KwQ8U2b8yGQ81t4xYCydeuDV6ltursm8L+QEG7dhTGTcu8wRkdTkZExhZ 3YTlTcmHZ4qTNsfLbp4ySomZUK2EH5ooqL45hl1F8yfDQTCYB0IaYJV8me6S23U1jFkWPR U113RZ1q28O2sfBD1NznHgjN0HiBl7a2vl1rCVw0JB4I6/CtkYwfChSyall1Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729877903; 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=/bsmPQaA3UMluJ/MYwhpkP/+mPHIa/7W/YZYq1W8FOQ=; b=hzuQdXTJS3S8OPPhyJhlCqz2VhZltbaI8kBQ14YAtl1VdSaVgsniAOCynYHuMs+nq2gHLK 5gOm6Fsg6WvFb4mlw5f21omE6dmHo3soA5Q/I7Sf1GCfTka2vEYuShl+t4lFiPKk4UjlVl 8XjeZ4dw8XD/ub8kbCX1DJPOpuPLaDb3HlZCWIPI7HSrevWIqTUdgc2oDYLb1v64QbgCq9 SJQbndUAeCySXUVJ7sq9zVc22POntYKVvUlSC4k+TNJJE19sq8T46xl9QBjowYKCRw4qrp nuMWu9w3vmtQ9inXTV7RGWmJgw9J9FupZ6wH86hrjMVYaFisFPwU9x9tmDjJLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729877903; a=rsa-sha256; cv=none; b=pXDDpc+NZPW/8bqgmFLAQcSUi9AWaFM34oaAFQS/eeoH6XNWuj3HErQRNMeF+oPdVdL+i7 QDxsduSexDNLUi5hPqy+h7wJVGgeAC585wpyIvSnCar15gjRk4yKvLvF7FQA2+bhlINCpJ nq1lZfYJbOpflGmcbag2OTGrQhRkqyg4RTY/beTzQk5drTccLfIwwzn/vLh8/fT+WZAYNT 7OsCGF/6EYCxxlxqXGV85COmUxu/jysqgOv4xZEzdr/Ym412s0Q0QYP3ajDaxKQ4i2ZVIj UfIkzjwUSbepuOWRgjZ1B5jXOgc5CPk4qfKJCcaSUCTSoomHg6RRrGZb9h8nnA== 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 4XZqkk6rZ2zbMf; Fri, 25 Oct 2024 17:38:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49PHcMa1012273; Fri, 25 Oct 2024 17:38:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49PHcMr4012270; Fri, 25 Oct 2024 17:38:22 GMT (envelope-from git) Date: Fri, 25 Oct 2024 17:38:22 GMT Message-Id: <202410251738.49PHcMr4012270@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: f11a9f19b298 - main - pctrie: drop meaningless neighbor check 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: f11a9f19b298e7d6dfa102275207e1b7c90aaff0 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=f11a9f19b298e7d6dfa102275207e1b7c90aaff0 commit f11a9f19b298e7d6dfa102275207e1b7c90aaff0 Author: Doug Moore AuthorDate: 2024-10-25 17:37:01 +0000 Commit: Doug Moore CommitDate: 2024-10-25 17:37:01 +0000 pctrie: drop meaningless neighbor check In PCTRIE_INSERT_LOOKUP_{G,L}E, there is a test - if two pointers are equal, replace one with a new value. The pointers can never be equal; one points to a struct pctrie_node and the other is the (void*) cast of a pointer to a field within a struct pctrie_node. So the tests and assignments can be removed with no effect. Reviewed by: bnovkov Differential Revision: https://reviews.freebsd.org/D47277 --- sys/sys/pctrie.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/sys/pctrie.h b/sys/sys/pctrie.h index d71290c8cf23..209380d805b2 100644 --- a/sys/sys/pctrie.h +++ b/sys/sys/pctrie.h @@ -147,8 +147,6 @@ name##_PCTRIE_INSERT_LOOKUP_GE(struct pctrie *ptree, struct type *ptr, \ *found_out = NULL; \ return (ENOMEM); \ } \ - if (neighbor == parentp) \ - neighbor = parent; \ pctrie_insert_node(parentp, parent, val); \ } \ found = pctrie_subtree_lookup_gt(neighbor, *val); \ @@ -178,8 +176,6 @@ name##_PCTRIE_INSERT_LOOKUP_LE(struct pctrie *ptree, struct type *ptr, \ *found_out = NULL; \ return (ENOMEM); \ } \ - if (neighbor == parentp) \ - neighbor = parent; \ pctrie_insert_node(parentp, parent, val); \ } \ found = pctrie_subtree_lookup_lt(neighbor, *val); \