From nobody Sun May 08 14:21:47 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 74F801AC5086; Sun, 8 May 2022 14:21:48 +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 4Kx61l6ccZz3F8l; Sun, 8 May 2022 14:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652019708; 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=lkqqofWXmVhX0ftjXv9Wqz3eF/mWQweAaxjRzhc28sQ=; b=PXITKJWez5zFAqeewA3StBZfyKTXU2/7YEfAYm3+Hf251Uwu5EW8OWtWoDkIga/V+BfZsx p9LlSQShAvqTZuS7beufQnT55eg8QayBzAmwuexISqJoD0yKr0nKawLXfDTKWUkPai7lmH +K+lq2UaNu/Xt1Bjfo41XJDoyb8SIiW6NlE7yDXEjRouwfzUo4+/9aObyVISte+Zsh6HEA 9/e3ksQMXRBGfqymaKFBdXbojgDeM799oR1SEQSnjdK5Zb6zNT6exQl6fSj+AH3oiqyzrx +N0nL1WKEYozr5E73fLatgIWhWwQVMzQwJLoumzcfgP2tB9NkqGM65lJu+CCuQ== 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 7CB3526498; Sun, 8 May 2022 14:21:47 +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 248ELluB037898; Sun, 8 May 2022 14:21:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 248ELlpk037897; Sun, 8 May 2022 14:21:47 GMT (envelope-from git) Date: Sun, 8 May 2022 14:21:47 GMT Message-Id: <202205081421.248ELlpk037897@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: c6df21760381 - main - linux(4): Use the right function to get the bit index in vdso binuptime. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6df21760381c3e48bcd412705de6f0ded9e4aae Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652019708; 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=lkqqofWXmVhX0ftjXv9Wqz3eF/mWQweAaxjRzhc28sQ=; b=Rf+cQRNk9oicplrgafi5xRSFw2Ynb9zM2AiIeUMxmSzS4E8rMDyCngKuGG1pprIpdVtl/n MKqNn/S+sqB5GFsNi3py4H7XFm7g1WrZL5sIyzgpBROXESLvJSRWDcYKG13DpF1WFMqX7z mGkuIygSNvhO/A6S4clYV53Hx0HnwK06PrLKWA+pdEby0qzFrqs4mhqyV/kzS+YV2CWqtL syduDeZ4Fj0LfSQ0KY4oNKCwFUtJxQbUb1xd8BRjiD8IAWkzTwtQ3pjRxT6aU2VnjTLJyY 3fEqRHTf51+6E3eG3ihkK6thXSRrd041xdEmhyB2kGyyNKS0H4pn5Y90RqThww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652019708; a=rsa-sha256; cv=none; b=Lewu1TwegBZjUO19AWSZnhdwIQxBBhQozD7sI33J+vfwgA2S5BpXAZ+QbX4MXiB+P6wFxy YeUnIF18lzbAlCRiZGmX4Piw6//d1Umg4hYpayghSMj0WzveXRthPFuVuSP6Y87LId87I7 kDFQtIssfyfc9ZCjc0LLR0wYx7+UaVISHZ+gslnzUyWPmUx6P8/IETpA2NSdsKXeJILnHq Wf8EeyWg1rE/RKSue0lIhikIAvHaCOgEEIDNPSAPReiJJjOz2a0lDlOSV/X12eabPLJmi2 qKPaF4m4lA9IEy2u7WL8UQ7o4HQa81MtZaZRGZrydi2SJiljN1q2JCmT6alpzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=c6df21760381c3e48bcd412705de6f0ded9e4aae commit c6df21760381c3e48bcd412705de6f0ded9e4aae Author: Dmitry Chagin AuthorDate: 2022-05-08 14:20:52 +0000 Commit: Dmitry Chagin CommitDate: 2022-05-08 14:20:52 +0000 linux(4): Use the right function to get the bit index in vdso binuptime. This is modeled after a1f93266 (by kib@). MFC after: 2 weeks --- sys/compat/linux/linux_vdso_gtod.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/compat/linux/linux_vdso_gtod.inc b/sys/compat/linux/linux_vdso_gtod.inc index 7320ce998d80..f101fe81f7f8 100644 --- a/sys/compat/linux/linux_vdso_gtod.inc +++ b/sys/compat/linux/linux_vdso_gtod.inc @@ -37,25 +37,25 @@ fls(int mask) #ifdef _LP64 static int -ffsl(long mask) +flsl(long mask) { int bit; if (mask == 0) return (0); - for (bit = 1; !(mask & 1); bit++) + for (bit = 1; mask != 1; bit++) mask = (unsigned long)mask >> 1; return (bit); } #else static int -ffsll(long long mask) +flsll(long long mask) { int bit; if (mask == 0) return (0); - for (bit = 1; !(mask & 1); bit++) + for (bit = 1; mask != 1; bit++) mask = (unsigned long long)mask >> 1; return (bit); } @@ -186,9 +186,9 @@ freebsd_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;