From nobody Fri Sep 06 18:35:24 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 4X0lK90MC8z5VS9J; Fri, 06 Sep 2024 18:35:25 +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 4X0lK85PHyz4W5G; Fri, 6 Sep 2024 18:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647724; 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=3INDcxAhBPilMelporugNULPgDuXzoMg91h08zK7KPo=; b=Ph7qGthFdU5LdbXEgOqenVM2f9+smtqVSE7gVETYO4AzJVSsYcxBOhjGfjoSb5yT77/I7u 1s310HlcjJCcBSqidKPwipI9I+OmtbwUosvA7kQkApR9vdcRRUx2YCedKUBl6zwRU97e5l i2GywUGOrZbN2bOKOzRsNNWdBWweW+07PmkXF4V03NI/ks0rsHLElNdqoxwm5QkHBD26x8 CNzvcA53WuFWmmSZhd9+yPXCxHp394PegVUeMhFKr75kP+7I4gXXhRhUaRtfx4fxrHDC2T 4y4X2YROOLKmpFc/9idl9VyxRWx6MX6RjoZw4efPOYB5Ugz0LZYxiCQvWkc9DQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647724; a=rsa-sha256; cv=none; b=B022UJpJlOyI40vvwUs7Sp/+E/ryC/EktOi97a9YH38pobwBULiUYkEYLEb5ePjOHXHaRE op5BiRi3PIbNnwQ9dG+KanYD61YTHhRICZIjW8cmHP5/0F4UmSrz42VPvnZXaMiacQR2rC YDt0ISAN1PUsMvgbkrKMpamel6is9RUMXek4S+J9OoamMDYSI/imX3ejKjaC3rt909g2dM NwpBx9z14XJjxj1GoUNfzD2WoQ26gofFzkJCl3Fu0+zjxCxtD3rM3p5YSBIKlGYjhchiQ6 7G3YMVBwzqVKOcUvg2iqvoxtoRyMvOYnzD8HbdEVIFKq3zHyzJLTff7bYYG6ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647724; 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=3INDcxAhBPilMelporugNULPgDuXzoMg91h08zK7KPo=; b=hu5y6y2pM2VXo9NHVwKfQkAsdXPG0Fccjnr6KMSNXVfmZQj2dc3pInD/g7sizO+meiVZG6 xraU/FJzbJ7xOIbhB2rc891s9hCP4ZAI16dRohDpzMCQ26tSrH2uTF07xIYsdZqpSs/bSO C5dFUKLRuBSyN5mfI1mhDAYf6Z0TGPXJPuVPmDinhpE+uj8ifufVMAEo3omGDJ52PrLeQ8 DPHgrPqdxPqJd/83bQU44nz0mo4OWvMnlGfEMk9FYjNuG1pXnkp/rJBFyPAy0VXI6yUTXC CVdaC89PY2d07hDZ/ccEsLKoB1HOXBiByD9D3Csc2rEB2Kdqz2UdZFMQLwEEiw== 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 4X0lK83wgwz135H; Fri, 6 Sep 2024 18:35:24 +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 486IZO4g011354; Fri, 6 Sep 2024 18:35:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZOrs011351; Fri, 6 Sep 2024 18:35:24 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:24 GMT Message-Id: <202409061835.486IZOrs011351@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 66145c3829c1 - main - ntptime: Use time_t for tv_sec related variables 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66145c3829c1753f3b5fa303c4e36bba172be553 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=66145c3829c1753f3b5fa303c4e36bba172be553 commit 66145c3829c1753f3b5fa303c4e36bba172be553 Author: Sebastian Huber AuthorDate: 2024-08-09 02:57:47 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:32 +0000 ntptime: Use time_t for tv_sec related variables The struct timespec tv_sec member is of type time_t. Make sure that all variables related to this member are of the type time_t. This is important for targets where long is a 32-bit type and time_t a 64-bit type. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1373 --- sys/kern/kern_ntptime.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index d2a2761ed683..65746021028b 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -193,7 +193,7 @@ static l_fp pps_freq; /* scaled frequency offset (ns/s) */ static long pps_fcount; /* frequency accumulator */ static long pps_jitter; /* nominal jitter (ns) */ static long pps_stabil; /* nominal stability (scaled ns/s) */ -static long pps_lastsec; /* time at last calibration (s) */ +static time_t pps_lastsec; /* time at last calibration (s) */ static int pps_valid; /* signal watchdog counter */ static int pps_shift = PPS_FAVG; /* interval duration (s) (shift) */ static int pps_shiftmax = PPS_FAVGDEF; /* max interval duration (s) (shift) */ @@ -742,7 +742,8 @@ hardupdate(long offset /* clock offset (ns) */) void hardpps(struct timespec *tsp, long delta_nsec) { - long u_sec, u_nsec, v_nsec; /* temps */ + long u_nsec, v_nsec; /* temps */ + time_t u_sec; l_fp ftemp; NTP_LOCK();