From nobody Thu Jul 18 18:59:05 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 4WQ2CY3zrJz5QBHP; Thu, 18 Jul 2024 18:59:05 +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 4WQ2CY3TMnz4s8T; Thu, 18 Jul 2024 18:59:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721329145; 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=hZHkhcry8T5Isvz6dTnY/fcm5miyz4LKECnRgQ+5C/c=; b=S8cODqMGEbqgq1X568ih6rZteV91/EIPlKaGnEnZ7UW/ULbtCnEDXwpmtj9AlArETc5x90 oqFOAvJijLyUaWeylRatdZ1mdYj/ukgLdB5PzF/ztJY4djTUM8Mnm60iV+8vioZNrVQnbb ZhCLmnDZV93ARH82+J+uaDetR/vW+6Jn2skTL7+2YF6GQxkMt9dVhkJNmERLrW31cXuWzo GESP9hj7Q5Y7wvIBJGxJLe35AjSDBMNhUusNk1VFeIYWiO5G3TxCtWzqvgIJctwXxEhTSl Jz5v/KecCdZDqQZ3w+UZ2TZY1EsaAgsSXHAs8MjNk9a6Dl3wLWMzP7GgDvU2lQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721329145; a=rsa-sha256; cv=none; b=p5aajiBpmejkLAePuiX7PyCu4svUG5HZI7SSeA+F3c2BTWz4/jEpT9WPJN8UoN+mhurQ2W swlbYghD0w7WsW8xhZPFMXC9cntqySa9hXyKoVeTqXM5CGgsaEMANGwB9fICd3XXFUH4pk 70k4eN9m5yWFgp45Ujrd2GnEq1t/UMrfWRUbTZNY/JiIAIEQYKDdMsX6x4//jpLWV3Z0/X rbJcymVJpowjVJ7cL1uHeYmm9Ys9B+oQjIkliQZjfEBpq0YbbuebwwuZGtS+BUhC9Fwo3D mMJ2uMb+mRqnx81nfIy7VyVhdfhBLBsg3mSg4xB5JuUzYFkpTy6UATkqULJ4ww== 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=1721329145; 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=hZHkhcry8T5Isvz6dTnY/fcm5miyz4LKECnRgQ+5C/c=; b=lyMHQF9DRDrXLpQ+L7no04h7s6rNXzTd+e2z9prDeBn7U2tGxlUSM1mn7InScVo1rCewHf 4NRPW8AESLubq8l+wBAAGgwCF3coGFCixKGOr26sWx4zyTTnPrrf2U9qRnRnkhMAmiwpeN wTZKP3EaLsVCZ29RSiKfAAMPbOQFws0IMYWBkgJHrHBCmBJV9iX8MbRyISRviZ5rWrSRt/ Z9z/k0UTZstEUIU8P5oqUOGr5/ikEj8ke+Rwq86zlvI0nwtvLqawQpjqjUdUARwAHreIej EwPWHjuKLFC39OLpkiY/R2Cr1/M7g9Q1NI7xvg4KkpbUUehSvhtZRB6f9FsVgQ== 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 4WQ2CY2sZbz115s; Thu, 18 Jul 2024 18:59:05 +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 46IIx56O034854; Thu, 18 Jul 2024 18:59:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46IIx5jk034851; Thu, 18 Jul 2024 18:59:05 GMT (envelope-from git) Date: Thu, 18 Jul 2024 18:59:05 GMT Message-Id: <202407181859.46IIx5jk034851@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: a527b9cb721a - main - axgbe: use standard rounddown_pow_of_two 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: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a527b9cb721a597a0bc5313ac55290cc6a91deac Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=a527b9cb721a597a0bc5313ac55290cc6a91deac commit a527b9cb721a597a0bc5313ac55290cc6a91deac Author: Doug Moore AuthorDate: 2024-07-18 18:56:31 +0000 Commit: Doug Moore CommitDate: 2024-07-18 18:56:31 +0000 axgbe: use standard rounddown_pow_of_two Drop an implementation of __rounddown_pow_of_two, which triggers Coverity warnings, and use the libkern implementation of rounddown_pow_of_two instead. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46022 --- sys/dev/axgbe/xgbe-sysctl.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/sys/dev/axgbe/xgbe-sysctl.c b/sys/dev/axgbe/xgbe-sysctl.c index 16523381e1a3..df81b1d7f0ae 100644 --- a/sys/dev/axgbe/xgbe-sysctl.c +++ b/sys/dev/axgbe/xgbe-sysctl.c @@ -244,22 +244,6 @@ exit_bad_op(void) return(-EINVAL); } -static inline unsigned -fls_long(unsigned long l) -{ - - if (sizeof(l) == 4) - return (fls(l)); - return (fls64(l)); -} - -static inline __attribute__((const)) -unsigned long __rounddown_pow_of_two(unsigned long n) -{ - - return (1UL << (fls_long(n) - 1)); -} - static inline int get_ubuf(struct sysctl_req *req, char *ubuf) { @@ -1049,12 +1033,12 @@ sysctl_ringparam_handler(SYSCTL_HANDLER_ARGS) return (-EINVAL); } - rx = __rounddown_pow_of_two(sys_op->rx_pending); + rx = rounddown_pow_of_two(sys_op->rx_pending); if (rx != sys_op->rx_pending) axgbe_printf(1, "rx ring param rounded to power of 2: %u\n", rx); - tx = __rounddown_pow_of_two(sys_op->tx_pending); + tx = rounddown_pow_of_two(sys_op->tx_pending); if (tx != sys_op->tx_pending) axgbe_printf(1, "tx ring param rounded to power of 2: %u\n", tx);