mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
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
This commit is contained in:
parent
dc048255b3
commit
0839258c56
1 changed files with 1 additions and 8 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in a new issue