From nobody Mon Feb 07 17:00:43 2022 X-Original-To: freebsd-hackers@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 9F32C19C261A for ; Mon, 7 Feb 2022 17:00:53 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4Jsspm2bQbz3QwS for ; Mon, 7 Feb 2022 17:00:48 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from sslproxy06.your-server.de ([78.46.172.3]) by dedi548.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1nH7Ne-0006Iq-Pf for freebsd-hackers@freebsd.org; Mon, 07 Feb 2022 18:00:46 +0100 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy06.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nH7Ne-000QFM-Mz for freebsd-hackers@freebsd.org; Mon, 07 Feb 2022 18:00:46 +0100 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 6A93148007D for ; Mon, 7 Feb 2022 18:00:46 +0100 (CET) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 1VsRp7StiGJR for ; Mon, 7 Feb 2022 18:00:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 22EFD4800A6 for ; Mon, 7 Feb 2022 18:00:46 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id GdprJCr1EWqb for ; Mon, 7 Feb 2022 18:00:46 +0100 (CET) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 05DF048007D for ; Mon, 7 Feb 2022 18:00:46 +0100 (CET) From: Sebastian Huber To: freebsd-hackers@freebsd.org Subject: [PATCH] kern_ntptime.c: Remove ntp_init() Date: Mon, 7 Feb 2022 18:00:43 +0100 Message-Id: <20220207170043.62630-1-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.26.2 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.103.5/26446/Mon Feb 7 10:43:31 2022) X-Rspamd-Queue-Id: 4Jsspm2bQbz3QwS X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of sebastian.huber@embedded-brains.de designates 85.10.215.148 as permitted sender) smtp.mailfrom=sebastian.huber@embedded-brains.de X-Spamd-Result: default: False [0.20 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:85.10.215.148:c]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BLOCKLISTDE_FAIL(0.00)[85.10.215.148:query timed out,78.46.172.3:query timed out,82.100.198.138:query timed out]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers]; DMARC_NA(0.00)[embedded-brains.de]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:85.10.192.0/18, country:DE]; RCVD_COUNT_SEVEN(0.00)[8]; HAS_X_AS(0.00)[] X-ThisMailContainsUnwantedMimeParts: N The ntp_init() function did set a couple of global objects to zero. Thes= e objects are in the .bss section and already initialized to zero during ke= rnel or module loading. --- sys/kern/kern_ntptime.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index a8418248abd7..96f14a408bcb 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -207,7 +207,6 @@ static long pps_errcnt; /* calibration errors */ * End of phase/frequency-lock loop (PLL/FLL) definitions */ =20 -static void ntp_init(void); static void hardupdate(long offset); static void ntp_gettime1(struct ntptimeval *ntvp); static bool ntp_is_time_error(int tsl); @@ -632,39 +631,6 @@ ntp_update_second(int64_t *adjustment, time_t *newse= c) NTP_UNLOCK(); } =20 -/* - * ntp_init() - initialize variables and structures - * - * This routine must be called after the kernel variables hz and tick - * are set or changed and before the next tick interrupt. In this - * particular implementation, these values are assumed set elsewhere in - * the kernel. The design allows the clock frequency and tick interval - * to be changed while the system is running. So, this routine should - * probably be integrated with the code that does that. - */ -static void -ntp_init(void) -{ - - /* - * The following variables are initialized only at startup. Only - * those structures not cleared by the compiler need to be - * initialized, and these only in the simulator. In the actual - * kernel, any nonzero values here will quickly evaporate. - */ - L_CLR(time_offset); - L_CLR(time_freq); -#ifdef PPS_SYNC - pps_tf[0].tv_sec =3D pps_tf[0].tv_nsec =3D 0; - pps_tf[1].tv_sec =3D pps_tf[1].tv_nsec =3D 0; - pps_tf[2].tv_sec =3D pps_tf[2].tv_nsec =3D 0; - pps_fcount =3D 0; - L_CLR(pps_freq); -#endif /* PPS_SYNC */ =20 -} - -SYSINIT(ntpclocks, SI_SUB_CLOCKS, SI_ORDER_MIDDLE, ntp_init, NULL); - /* * hardupdate() - local clock update * --=20 2.26.2