mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
net: bridge: Slightly optimize 'find_portno()'
The 'inuse' bitmap is local to this function. So we can use the non-atomic '__set_bit()' to save a few cycles. While at it, also remove some useless {}. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
cb3ef7b000
commit
cc0be1ad68
1 changed files with 4 additions and 4 deletions
|
@ -397,10 +397,10 @@ static int find_portno(struct net_bridge *br)
|
||||||
if (!inuse)
|
if (!inuse)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
set_bit(0, inuse); /* zero is reserved */
|
__set_bit(0, inuse); /* zero is reserved */
|
||||||
list_for_each_entry(p, &br->port_list, list) {
|
list_for_each_entry(p, &br->port_list, list)
|
||||||
set_bit(p->port_no, inuse);
|
__set_bit(p->port_no, inuse);
|
||||||
}
|
|
||||||
index = find_first_zero_bit(inuse, BR_MAX_PORTS);
|
index = find_first_zero_bit(inuse, BR_MAX_PORTS);
|
||||||
bitmap_free(inuse);
|
bitmap_free(inuse);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue