From nobody Tue Feb 08 19:44:55 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 B34B319B52AC; Tue, 8 Feb 2022 19:44:56 +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 4JtYPg6PLnz4pPZ; Tue, 8 Feb 2022 19:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644349496; 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=066LKHrf3njiw9+mrALUUjvJpYeu2Ai2lj4nY03602E=; b=I+eP9ZHpTpdkBXRrLPODmatNZCeSKshE1eI0r0cl0+ogxuE3jN1w8DQzPq1gwHZ8F9GNRa Bi5cGlLT0v9x8bI/5ch3RybaQJ1eDbl/J98c77y+Xix74h6Jy6Q7XXEMXLL70EdcRWAhup moER6iMP1bhxRtYECV1ceAiXlCE74hZufOX7x/lW1P2y6KI49ZdtrPbem/Rndw1bZBUfIv V5IUD/HoBkvZGfcBtBjqSMXdXwgT63yWHiU2bHLCaUTcmMZCPYhInMNr6siNhOO2bTdYWa Rq8mHv/thIisb6rVD39ElyTUN1kAlclpDm3DGkKuB+Khb5TIx7iDxwI7/wOp1w== 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 38D781F727; Tue, 8 Feb 2022 19:44:55 +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 218Jittp082284; Tue, 8 Feb 2022 19:44:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 218JitjT082283; Tue, 8 Feb 2022 19:44:55 GMT (envelope-from git) Date: Tue, 8 Feb 2022 19:44:55 GMT Message-Id: <202202081944.218JitjT082283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: a1f9326607de - main - libc binuptime(): use the right function to get the most significant bit index 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1f9326607dea5ab6979935e3ca2d7402dcc7cc1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644349496; 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=066LKHrf3njiw9+mrALUUjvJpYeu2Ai2lj4nY03602E=; b=mfF5fPBs+1nQY2q5JHAukpq94CWD0pB3n15ykfWD8206gwymZ44m8ONmcYPDO0C4cOigAp PWbPUiDl7B/fHwao6wnAroqk/TiP0A80mfz7ODkKCsFX7NUrZGysKie99ohzB1Iu1u3E+i LtAnaaOoZjuTXdmxes/RcHf5oE2gUV16nWXy1gx1CvumRm32czHCOGj9zVHxPhCs7LrntH DCOAYeFEthL+NqENV/L1F8mMF+lXj284gr8P1gnn8RFo7Cr8DE+yjLhjYR1/OgtgUM8FHi oeR44SW+jL6F69Pc/1E9mAtYK2KcHmyIEZfI9alV5BrAr78ZhDtSxT4ijPd8TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644349496; a=rsa-sha256; cv=none; b=JeL6n1seSX8uVOxnliosR5hjoxzhn542+QVCoAmAJmz/w0/S/xY2WxaAxnHgzRj2FH1pqH vJLssEPwrkrfaHfXqQmF0taUopToNookcQ8ukaUB/JIMv/1lahuFUXsoCvCZX0MtOWwESK DmV+qs5XYhP9kwHJgIT0joYA8E9g48KlgCYj9GWCv711EzFItM6lveRReoMM6BpsMfEGQv 0j1YDa/2eidASodYU6LGvSuVNCI5cwB6USf4aSyV6ycml1PBGB7gMOavYG5oId4A0ppORJ ekHgGXZKX2gt5bCLANExRziHzD4L5fFlFESjqqrR+fSsHBxD4enSLddh4r81tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a1f9326607dea5ab6979935e3ca2d7402dcc7cc1 commit a1f9326607dea5ab6979935e3ca2d7402dcc7cc1 Author: Konstantin Belousov AuthorDate: 2022-02-08 19:13:40 +0000 Commit: Konstantin Belousov CommitDate: 2022-02-08 19:44:23 +0000 libc binuptime(): use the right function to get the most significant bit index Reported and tested by: Jaroslaw Pelczar PR: 261781 Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libc/sys/__vdso_gettimeofday.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/sys/__vdso_gettimeofday.c b/lib/libc/sys/__vdso_gettimeofday.c index c1457a54d37e..cf1400cdf291 100644 --- a/lib/libc/sys/__vdso_gettimeofday.c +++ b/lib/libc/sys/__vdso_gettimeofday.c @@ -83,9 +83,9 @@ binuptime(struct bintime *bt, struct vdso_timekeep *tk, bool abs) return (error); scale = th->th_scale; #ifdef _LP64 - scale_bits = ffsl(scale); + scale_bits = flsl(scale); #else - scale_bits = ffsll(scale); + scale_bits = flsll(scale); #endif if (__predict_false(scale_bits + fls(delta) > 63)) { x = (scale >> 32) * delta;