From nobody Tue Sep 27 21:19:14 2022 X-Original-To: dev-commits-src-main@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 4McXYt4HL3z4cxwh; Tue, 27 Sep 2022 21:19:14 +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 4McXYt3pwgz4L39; Tue, 27 Sep 2022 21:19:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664313554; 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=kPu3miHH56q9r31/9POspqEnavt18tx7VedZbTig3MY=; b=Y4zegt88rZXNtyP0F/1B9uIooPDqp8iW3Y9ir3sMB2bPIiye1ks6qqqsUoFpDTYZ2iuanP II0eB/YBovsiHX7uMkksduRwq/ziOMjEDm8892GeeCrayFsvrrX/D7Fwxg0/fF9vUSRvQE DNVzQcIDfA4UmTWyb5HwCfpOrE79WwxHcoRyMZZIvuFJLL9vmBwCl7XwJfHxcN2ho5hCrx sbWwNZsklAWMxg3F8HHyCjgn/GoVdFZLSg6pXLmPrxtkvjVbcJVQMInO7aJwOqJjDVkunV o88BVwJVNWjXbKrCCvq78bot0NAkG0u3OjnViBqvuYg4ziPu43PGdc3BUf316Q== 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 4McXYt2tR7zFlV; Tue, 27 Sep 2022 21:19:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28RLJEOh062227; Tue, 27 Sep 2022 21:19:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28RLJEHf062226; Tue, 27 Sep 2022 21:19:14 GMT (envelope-from git) Date: Tue, 27 Sep 2022 21:19:14 GMT Message-Id: <202209272119.28RLJEHf062226@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: 9f6f9007b98f - main - name2oid: use find_oidname List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 9f6f9007b98fc407a1b064c4492697e27954191a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664313554; 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=kPu3miHH56q9r31/9POspqEnavt18tx7VedZbTig3MY=; b=lxzddzhl+254zPVCe4BXbgEJHvl2UMaNTbgGV8g4qliBEaXGGWMbah0JvY28vIhPBuMyf6 lsdSbuHIQLv5jiQsr+HtWVAKTZsG5yHI7Uc1P5jDCbKeejZQjKyOWSUFf2C1PYOLghom0q lmJb62QQ04lbh+fhG02FQA0eWzu4jYrbBfUib2Kv4ZL01KMciZoRQVpgD6kACvTvuHySGK 2fzsOe97FWDZSOQj6/vVac31ZI/zWpBxrTxfUsS2uKF0md+Io4lmTuHL7MiqLo+RJSMgUy bl5hRrSn3wubS3I7/+6iQLw/yNhSx2J7pKUYoYezTH7JBUv1SePyFEi/fkLOgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664313554; a=rsa-sha256; cv=none; b=sb5BGcTwTFmzWOzZjPQuR6i0PeES6FMY8AHw1f5RTwYemGwOvWoG1npWEgGAAi3Qv8JcWV uPBuc0oRMD54rKdJEyEJdpgyAsoP6eaT0wRw/5EKqfEs84yQyPVcghmjdq15LWa+LsNrpU 6AhEpV/HfoMM/9XpvUqyoXjTsY4f8mEDpD4GSJIdOHBAa9CExy+Lyl/nc07MOljc0JZPQV Scrm5+NQ79msKjPJH854LwQiFYuETqrpbM6+Mqe5bKhepqallQeSTV7eXoxBSUOI+gguR5 RKxBhRJgWfj8bM36pS6jq6woKuXtbXZ2DXMhV7Q6VNuoafC/GkZYCQaZD6aE/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=9f6f9007b98fc407a1b064c4492697e27954191a commit 9f6f9007b98fc407a1b064c4492697e27954191a Author: Doug Moore AuthorDate: 2022-09-27 21:17:55 +0000 Commit: Doug Moore CommitDate: 2022-09-27 21:17:55 +0000 name2oid: use find_oidname In name2oid, use sysctl _find_oidname instead of re-implementing it. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D36765 --- sys/kern/kern_sysctl.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index a655e9e50677..1267ac8c9f63 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1326,17 +1326,11 @@ name2oid(char *name, int *oid, int *len, struct sysctl_oid **oidpp) { struct sysctl_oid *oidp; struct sysctl_oid_list *lsp = &sysctl__children; - char *p; SYSCTL_ASSERT_LOCKED(); for (*len = 0; *len < CTL_MAXNAME;) { - p = strsep(&name, "."); - - SYSCTL_FOREACH(oidp, lsp) { - if (strcmp(p, oidp->oid_name) == 0) - break; - } + oidp = sysctl_find_oidname(strsep(&name, "."), lsp); if (oidp == NULL) return (ENOENT); *oid++ = oidp->oid_number;