From nobody Fri Jan 27 15:10:16 2023 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 4P3Lbr3nRPz3cB2N; Fri, 27 Jan 2023 15:10:16 +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 4P3Lbr3781z3Knh; Fri, 27 Jan 2023 15:10:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674832216; 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=NC+JUVOpcm18CTHi1m94XBQZIl90Xc0CkotQ2CxRbmU=; b=NlLTqHkO9EVyzE/7bkqibf1vgD+sCRwyZQR71u/nEHqMy/eJ+G1mwrroaZY2YPMd48tHVO AHMO5VhtPSKDKM9DZ8abKor9GaC/flhYiG6HcpdEWfSyxy2B23qwyigluVRsALtaTXO3M4 Wc+5MpyPztmGMZF66zJ6UgqOvo5QaSYyaX+fOzfWYhzUV3oinBowhRzF8OsE1jeVxxLf32 xoCBKdfVdgTSdVBscz3HSV2FbRNl1nsV6C1dezawMLJGvj+GJsfkAEq+KBb0GeMvsvbohz MKKXIMAqmehZR2H7I8tGYbTaDnrC4PnZ79DtDvyJB3DktjtxY298xtJeHgVF3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674832216; 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=NC+JUVOpcm18CTHi1m94XBQZIl90Xc0CkotQ2CxRbmU=; b=IiPk8o9ewnrhKu8DAPdaVEc1oPAsJ2KboAcVuOdPdEWuNHHr48etsgWLlU/I9NRpFuAlLv AuPCIDUqpBLivuLIiNYBqQ7+BWRFtQPeLRhnQgiGx8tJIktqj74/aQasq6k6K5hyCqYVuc oGztPT9MktopCd/nrpcj8xiMcV+Lm//ncrJWsYDJvze57NqLjg71Jc99SIAkhJb3RCpPrP 3ootZkHoTsg6tHpSPkeTElvW8ctQ4XEpdTaMQQ1rDYUVIz4R3h6Uk9spnd/F8dELnSRRLi y3K1ZdYVWKYiyUyUmR0we81KrRUVKkTuH4x00ZtfFAZqZytdlLDrDz91Guan4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674832216; a=rsa-sha256; cv=none; b=bP4S5qq8Pmxbelsp0L93U+IgHefh0EIwm+XvEov8Wj9cQupcufcwKWAPpOHSVsGzc/VjRQ NFv6Bql7W4TFgPFu4rHGhH1JrLg+iCuceMARR8/w2CWO63KMAwWBO9181hexoRBtcOdvlL tUN2qVKhMbu+LqLKA7riCL1AK34ZUsa/x1k9AOhmvpb3PUVUUr9LvcsLwqsMKXkpoHu9o7 hguqd6kbgql6uRRH9AiyJYipWmAXsX13V5JOjLaWYXUo3DAyuHale++1/uT+Lgc6RK7MPP 6B6uOuZHOlAn3JdWsXiD6rYpSXRveu4Tpnw4VOAu/VinH9AtyYFM+jNqNOPvXQ== 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 4P3Lbr22kjz1CWb; Fri, 27 Jan 2023 15:10:16 +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 30RFAGi7065464; Fri, 27 Jan 2023 15:10:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30RFAGEJ065453; Fri, 27 Jan 2023 15:10:16 GMT (envelope-from git) Date: Fri, 27 Jan 2023 15:10:16 GMT Message-Id: <202301271510.30RFAGEJ065453@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: f394d9c0a40f - main - sysctl: use correct types and names in sysctl_*sec_to_sbintime 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f394d9c0a40f038facc2b96083e094230aa2d608 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=f394d9c0a40f038facc2b96083e094230aa2d608 commit f394d9c0a40f038facc2b96083e094230aa2d608 Author: Gleb Smirnoff AuthorDate: 2023-01-27 15:09:22 +0000 Commit: Gleb Smirnoff CommitDate: 2023-01-27 15:09:22 +0000 sysctl: use correct types and names in sysctl_*sec_to_sbintime The functions are intended to report kernel variables that are stored as sbintime_t (pointed to by arg1) as human readable nanoseconds or milliseconds (reported via sysctl_handle_64). The variable types and names were reversed. I guess there is no functional change here, as all types flipped around were signed 64. Note that these function aren't used yet anywhere in the kernel. Reviewed by: mav Differential revision: https://reviews.freebsd.org/D38217 --- sys/kern/kern_sysctl.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 6427ff0c7ecf..430fa87ef0eb 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1889,47 +1889,41 @@ retry: } /* - * Based on on sysctl_handle_int() convert microseconds to a sbintime. + * Based on on sysctl_handle_64() convert microseconds to a sbintime. */ int sysctl_usec_to_sbintime(SYSCTL_HANDLER_ARGS) { int error; - int64_t tt; - sbintime_t sb; + int64_t usec; - tt = *(int64_t *)arg1; - sb = sbttous(tt); + usec = sbttous(*(sbintime_t *)arg1); - error = sysctl_handle_64(oidp, &sb, 0, req); + error = sysctl_handle_64(oidp, &usec, 0, req); if (error || !req->newptr) return (error); - tt = ustosbt(sb); - *(int64_t *)arg1 = tt; + *(sbintime_t *)arg1 = ustosbt(usec); return (0); } /* - * Based on on sysctl_handle_int() convert milliseconds to a sbintime. + * Based on on sysctl_handle_64() convert milliseconds to a sbintime. */ int sysctl_msec_to_sbintime(SYSCTL_HANDLER_ARGS) { int error; - int64_t tt; - sbintime_t sb; + int64_t msec; - tt = *(int64_t *)arg1; - sb = sbttoms(tt); + msec = sbttoms(*(sbintime_t *)arg1); - error = sysctl_handle_64(oidp, &sb, 0, req); + error = sysctl_handle_64(oidp, &msec, 0, req); if (error || !req->newptr) return (error); - tt = mstosbt(sb); - *(int64_t *)arg1 = tt; + *(sbintime_t *)arg1 = mstosbt(msec); return (0); }