The branch main has been updated by dougm:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=0839258c5690cd7cd0dcd10a089fc20ce73225c1

commit 0839258c5690cd7cd0dcd10a089fc20ce73225c1
Author:     Doug Moore <[email protected]>
AuthorDate: 2024-06-24 07:24:24 +0000
Commit:     Doug Moore <[email protected]>
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),

Reply via email to