From nobody Mon Jan 30 18:11:20 2023
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 4P5GTP1HgRz3c78W;
	Mon, 30 Jan 2023 18:11:21 +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 4P5GTP0tgbz3Hrd;
	Mon, 30 Jan 2023 18:11:21 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1675102281;
	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=D0H6YdAM2ahSNgd79P83rem+w+NwSpM04xM092BIaJM=;
	b=pa8zYZoE06bzovIaAQvlhxZZsOtUfVvtCx7bPGyjv0uzR/+FbQxAM5wfwGE8EPpdv7j2Xa
	aelNccRljtInPZOBlTGRVFcf3/FfmoCWlFzZijoIMfh0KIOS0gySGGKydbjw1cuZBr1A8U
	iE76B7YM5XnycEUsyX7x0T3s2b9cP/ipI8Ert3vFLJ/ZNnfxCt8yNY/uxZbIiAEAJ/yI8z
	2snndyT+Ijg3LE36pCPOeC8lUy7Hy0TbD3G54BVqjEJnYMZmcnZ0qiD9fKSNNcD+heszTj
	qUSFzOiGuW/U18izOLq1WcpJ7TYxDVp+HTDb4lsNTR9Nv+HOvyWVLjo4PEwR7g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1675102281;
	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=D0H6YdAM2ahSNgd79P83rem+w+NwSpM04xM092BIaJM=;
	b=rBeJZkU0RrTqAkzL9ZOtYHzDiMguoo56LmHbJTeV2yRjxDOLQt8ji/K//mClMG04K5q1Yj
	0LZIqh8DGdew5Xq+pD4qCchjjSByubiCjvS+/0bkXBvrCWiNr1VqF7Wt5g75/pHeSwfEVP
	2QptrGfnnrontnziBhvXWL4Ji1WO4/f/XX40ZgOBkPrUhJdnVA48A2n9fmQlVweweFifSz
	5il5xkGlLbBt0e88Lj3MM7VjOA9/B5SrCo8qGeQwVAhZPYAqv1/wnJ5gyRa2aspFDOhZRT
	c2sDLGQZmrUFR4Du2iYqO2lK9nS/Wk9Sl2dfyJ7SfEAn2n6sNKhfjxoYUA83pg==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675102281; a=rsa-sha256; cv=none;
	b=TywSe7xdmmYdp1TwUVdyX7b/pI5VzT6AEDg9iuT2hvjhvZqAL+RWfAWJ1pvgYvjbj5wnAg
	AUKcK4UCi06oiNgAg8y2jPMJ1JbT3q4eRoUGJbhyjREES+Ufq8Zw4GuSFhQ9TLX0mLSyf4
	Q/brbHYoAwR9rjmdcXPc62fht/kLeBSNrc6fx6h78wgOFyM6PUlbwy8vvjrjJosC6cgjDl
	uhrEzZGsOQvFNReGXGrx4EKo3yh1kXONTAYByih55bwMQUbryoTnqhoVWGHRaAlbwJdbCd
	CuweN931P3ED81lbkA5+goHiAZCFinNtr9tzAx8Znmr7x/Ai7fOhq9ybUcIU1w==
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 4P5GTP003gzJ66;
	Mon, 30 Jan 2023 18:11:20 +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 30UIBKiO015918;
	Mon, 30 Jan 2023 18:11:20 GMT
	(envelope-from git@gitrepo.freebsd.org)
Received: (from git@localhost)
	by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30UIBKrG015917;
	Mon, 30 Jan 2023 18:11:20 GMT
	(envelope-from git)
Date: Mon, 30 Jan 2023 18:11:20 GMT
Message-Id: <202301301811.30UIBKrG015917@gitrepo.freebsd.org>
To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org,
        dev-commits-src-main@FreeBSD.org
From: Warner Losh <imp@FreeBSD.org>
Subject: git: c7c53e3ca631 - main - Clarify hardpps() parameter name and comment
List-Id: Commit messages for the main branch of the src repository <dev-commits-src-main.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main
List-Help: <mailto:dev-commits-src-main+help@freebsd.org>
List-Post: <mailto:dev-commits-src-main@freebsd.org>
List-Subscribe: <mailto:dev-commits-src-main+subscribe@freebsd.org>
List-Unsubscribe: <mailto:dev-commits-src-main+unsubscribe@freebsd.org>
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: imp
X-Git-Repository: src
X-Git-Refname: refs/heads/main
X-Git-Reftype: branch
X-Git-Commit: c7c53e3ca6312c99a0e179e51357a1933de95b5a
Auto-Submitted: auto-generated
X-ThisMailContainsUnwantedMimeParts: N

The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=c7c53e3ca6312c99a0e179e51357a1933de95b5a

commit c7c53e3ca6312c99a0e179e51357a1933de95b5a
Author:     Sebastian Huber <sebastian.huber@embedded-brains.de>
AuthorDate: 2023-01-25 12:43:11 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-01-30 18:07:40 +0000

    Clarify hardpps() parameter name and comment
    
    Since 32c203577a5e by phk in 1999 (Make even more of the PPSAPI
    implementations generic), the "nsec" parameter of hardpps() is a time
    difference and no longer a time point.  Change the name to "delta_nsec"
    and adjust the comment.
    
    Remove comment about a clock tick adjustment which is no longer in the code.
    
    Pull Request: https://github.com/freebsd/freebsd-src/pull/640
    Reviewed by: imp
---
 sys/kern/kern_ntptime.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c
index 96f14a408bcb..6d03413a3113 100644
--- a/sys/kern/kern_ntptime.c
+++ b/sys/kern/kern_ntptime.c
@@ -733,11 +733,11 @@ hardupdate(offset)
  * variables, except for the actual time and frequency variables, which
  * are determined by this routine and updated atomically.
  *
- * tsp  - time at PPS
- * nsec - hardware counter at PPS
+ * tsp  - time at current PPS event
+ * delta_nsec - time elapsed between the previous and current PPS event
  */
 void
-hardpps(struct timespec *tsp, long nsec)
+hardpps(struct timespec *tsp, long delta_nsec)
 {
 	long u_sec, u_nsec, v_nsec; /* temps */
 	l_fp ftemp;
@@ -774,12 +774,9 @@ hardpps(struct timespec *tsp, long nsec)
 	/*
 	 * Compute the difference between the current and previous
 	 * counter values. If the difference exceeds 0.5 s, assume it
-	 * has wrapped around, so correct 1.0 s. If the result exceeds
-	 * the tick interval, the sample point has crossed a tick
-	 * boundary during the last second, so correct the tick. Very
-	 * intricate.
+	 * has wrapped around, so correct 1.0 s.
 	 */
-	u_nsec = nsec;
+	u_nsec = delta_nsec;
 	if (u_nsec > (NANOSECOND >> 1))
 		u_nsec -= NANOSECOND;
 	else if (u_nsec < -(NANOSECOND >> 1))