From nobody Mon Jun 24 07:27:59 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 4W701C4q2Nz5NX7S; Mon, 24 Jun 2024 07:27:59 +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 4W701C1z7Kz4Tb2; Mon, 24 Jun 2024 07:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719214079; 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=QPuGOCOyRZ4wqEqGsdgPCrjduOnAfBfvZ0fiPGe3W3w=; b=Z8L/PNZLK1Lv8LxU4SbKe57r140J5HiLi4eh7QleveuYj7j3tBE/NvhYAjO36WT8z837se jDwTHQ2jgHa8uuF6SBsbKkYC1N2fatByG1GocgQ6WoD0SKgRDT4TlG40DsljaRfxVphDCc slfkWfg5onIIy6vv26zJT2FF7suOjXkhBO4OORvizrLWkRZ3JEhIfbjNgcGKBcrce1qM2d V2GC7CopQDpBp7dFkYyWZaYr9Wli1d5dNF8FK/cv2d4u4+RstQ7DnVvUkVwM9MKysMBZtj q3CP8O855eJ5hQ4QyR/AP7gc9hru5yrSFp0M492zvQTm5Zh6Plu7xcfq/6qJfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719214079; a=rsa-sha256; cv=none; b=uVb1J8Pou2/c9TzJt7aQFrWOkdCKO9yASMX5R4RwENCTZHyWo3+LUGayZbqW98xFK8mMHK KLvmPKcNEOGWUN/r6PFI2wSQE2mOyxlmtHdRnfQbBHhRe6gpOuR0GEfhoFVzJzJNXjIG9w 2hLla/+o7QUIGTXh02ytbryw5cY7BxwMEFzfBxkzdHYwlChpNGTNGjBn/m8JZQF8hiBD9s 6OxeqV7zbSCRRG2ezKwC2iIhq0Z3M2JPg5X7b97fPDS2tXVRB1lNAdZ9CYb5Rozw68bKC7 YSzXmVwHwIMQhojM4hlvqlMBiNzVJnZL0wD1VtEgiysvz8WU4r/+qYIdLmQqIA== 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=1719214079; 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=QPuGOCOyRZ4wqEqGsdgPCrjduOnAfBfvZ0fiPGe3W3w=; b=lqBpQ34MdDZf7XAcucWKu8NUWqJ6BWpa4ZR9RG9hTWO9737XpXRAq+qiF77FAqcb+1bQ23 IROJ8d7QzrLumgxWqln8ZqdruOZKrDh19JsBmddKltzW6maETkfkF9OvEQ+QbeH9Gj2KYk yAoC3vp5BFgfePTQeapUek/vMp22trs3mYjd3aXC1YCqX8TDEFa93LFNI2LJtjQzLqbja3 Oerk/128CZYQ7T2mvrK88PtXD2JxzDcWdoAv9U3f2EAFBsb5GqwYu4BQg88hK2LYv4XHxf ji5ZtyhJQMpw3f4vCEaHpYT7lMvbSBoXi6MDg+xhtZqvYm74Mda+UyGClh8M1Q== 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 4W701C14Vsz18F3; Mon, 24 Jun 2024 07:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45O7RxNA044565; Mon, 24 Jun 2024 07:27:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45O7Rx4q044563; Mon, 24 Jun 2024 07:27:59 GMT (envelope-from git) Date: Mon, 24 Jun 2024 07:27:59 GMT Message-Id: <202406240727.45O7Rx4q044563@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: 0839258c5690 - main - ipfw: Use roundup_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: 0839258c5690cd7cd0dcd10a089fc20ce73225c1 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=0839258c5690cd7cd0dcd10a089fc20ce73225c1 commit 0839258c5690cd7cd0dcd10a089fc20ce73225c1 Author: Doug Moore AuthorDate: 2024-06-24 07:24:24 +0000 Commit: Doug Moore CommitDate: 2024-06-24 07:24:24 +0000 ipfw: Use roundup_pow_of_two Use roundup_pow_of_two in place of a local function that does the same thing. Reviewed by: alc, markj Differential Revision: https://reviews.freebsd.org/D45536 --- sys/netpfil/ipfw/ip_fw_table.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw_table.c b/sys/netpfil/ipfw/ip_fw_table.c index 5cf948ce39a2..92bb7a63fd5a 100644 --- a/sys/netpfil/ipfw/ip_fw_table.c +++ b/sys/netpfil/ipfw/ip_fw_table.c @@ -1512,13 +1512,6 @@ destroy_table(struct ip_fw_chain *ch, struct tid_info *ti) return (0); } -static uint32_t -roundup2p(uint32_t v) -{ - - return (1 << fls(v - 1)); -} - /* * Grow tables index. * @@ -1540,7 +1533,7 @@ ipfw_resize_tables(struct ip_fw_chain *ch, unsigned int ntables) if (ntables > IPFW_TABLES_MAX) ntables = IPFW_TABLES_MAX; /* Alight to nearest power of 2 */ - ntables = (unsigned int)roundup2p(ntables); + ntables = roundup_pow_of_two(ntables); /* Allocate new pointers */ tablestate = malloc(ntables * sizeof(struct table_info),