From nobody Wed Sep 28 09:31:54 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 4McrqG656Pz4dQZT; Wed, 28 Sep 2022 09:31:54 +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 4McrqG5gLjz46TH; Wed, 28 Sep 2022 09:31:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664357514; 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=BXwkoK0LT/1b200WKd94oMwaRkFhoQ78IDIOVoG9Dg4=; b=f4fikZUrWsIsJIFTU/9RmsXcySSp+5xhkRJvrYbD2+cCWgTDYTmS7Q5EVotU12kKbqvKa9 PJeU910Gam6SRwoqfwt3D4k0hMPytH1cFkFHlXkeDpcQocIrTucMjmg6yY+KZpMqHwIU+R vP/XMnoPAbSK6FI7619H74AG4/XYpsbnzJjUnj/ZpOCsXmkF/I6qBVh1+qDLkaPVG1hQ08 hlNcwxcJL/7cJnYvM2ggaL1oX2LcTOvbap33mIZ6Czu0jyn5Mvvvoe2m6mTwotF+KjdAPQ H5MMIqnQkZ+c6zxw/NLpZgBeqp4ipqPg1kKjvTiUFpNbUqzpZU8sDpNe7z8KhQ== 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 4McrqG4kt1zQkg; Wed, 28 Sep 2022 09:31:54 +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 28S9VsZd078043; Wed, 28 Sep 2022 09:31:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28S9VsBN078042; Wed, 28 Sep 2022 09:31:54 GMT (envelope-from git) Date: Wed, 28 Sep 2022 09:31:54 GMT Message-Id: <202209280931.28S9VsBN078042@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: 5294bfa75166 - main - sysctl_search_oid: remove all-NULL precondition 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: 5294bfa75166932497bab87a7e565d94a07341fb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664357514; 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=BXwkoK0LT/1b200WKd94oMwaRkFhoQ78IDIOVoG9Dg4=; b=BTRC0UgOG78OkyUMrD1DfOTcYZnW+95rrQnJQPPhZ1jkuOFpwLnjekm92yVk7122//FsrC ix6zxuVVfNynE7wZ6rmua4TPKwXczPPkXO+30cGiAk1veTNsnRyNqQo6edz3UbMhmgUV48 7NhWAZTbG7jz0V/cpdMsMA+HGHuMfPUO/X9/9ATWRcVOT8up8flZqEcFfIKfJtqZprmeWS 8ngmLrVhNmx+tN/GedUK3Ny8o6AuIot8GoKfs4A3/SFyY8LfSx7CVXbJ3Qm9Od0/W4PvJu cjNfP3z+O58bwNM0SAc9gTvdndmkMWuSLHbkrXSVL0dXtZZ1WEMdckjZ/Zok3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664357514; a=rsa-sha256; cv=none; b=iUbRKDw2bYYoirD9+zzd3pOH8npIvuOP4SyiMcBdVOwJ8SrpvTcMO3uqR1DDpbd1UJadx6 X2JOmE51ziEYKQyBD6LiHNUbZ732FNbzE81P+HpplUEE8tuVu2mh0xx5QS7MBXgtBZ8ZrA fsaS0BMyCuRWGWxZifGz3lGKtDhsaNg6si7m0QzPEalVqDwscmIVI6tG0HLHj8AHcHCJC7 ikkDDK/YkqAqfCuE4vTgFKn/j+skeCH3lGQKiRtl3BJkCSmJTvAk4luJ0QJMYma81eHC+5 tGaeeq6083k0TwbctMD1F5G7WOoGBEOvsJ/JI5kTN/4CnzaxE0VX5m1bHd0jfA== 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=5294bfa75166932497bab87a7e565d94a07341fb commit 5294bfa75166932497bab87a7e565d94a07341fb Author: Doug Moore AuthorDate: 2022-09-28 09:30:11 +0000 Commit: Doug Moore CommitDate: 2022-09-28 09:30:11 +0000 sysctl_search_oid: remove all-NULL precondition The implementation of sysctl_search_oid no longer relies on the initial value of nodes to be all NULL, so remove the comment that demands it and let the caller stop enforcing it. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D36768 --- sys/kern/kern_sysctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 1267ac8c9f63..8e4b69bb6eee 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -347,7 +347,7 @@ sysctl_load_tunable_by_oid_locked(struct sysctl_oid *oidp) /* * Locate the path to a given oid. Returns the length of the resulting path, * or -1 if the oid was not found. nodes must have room for CTL_MAXNAME - * elements and be NULL initialized. + * elements. */ static int sysctl_search_oid(struct sysctl_oid **nodes, struct sysctl_oid *needle) @@ -401,7 +401,6 @@ sysctl_warn_reuse(const char *func, struct sysctl_oid *leaf) sbuf_printf(&sb, "%s: can't re-use a leaf (", __func__); - memset(nodes, 0, sizeof(nodes)); rc = sysctl_search_oid(nodes, leaf); if (rc > 0) { for (i = 0; i < rc; i++)