summaryrefslogtreecommitdiff
path: root/net/bridge
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2026-06-04 14:13:36 +0000
committerJakub Kicinski <kuba@kernel.org>2026-06-05 17:46:17 -0700
commit2013ebb9b3819dd74a9b26634e49453046b63037 (patch)
tree7cfa1bd5ef03be99c7719af125c9aadb391262e3 /net/bridge
parentf8bcd307572591838d359920c23183ab9fbb423c (diff)
downloadlinux-next-2013ebb9b3819dd74a9b26634e49453046b63037.tar.gz
linux-next-2013ebb9b3819dd74a9b26634e49453046b63037.zip
bridge: use BR_ADMIN_COST_BIT
Use set_bit() and test_bit() lockless functions. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Acked-by: Nikolay Aleksandrov <razor@blackwall.org> Link: https://patch.msgid.link/20260604141343.2124500-5-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_if.c2
-rw-r--r--net/bridge/br_stp_if.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 080e61d2414a..630ca7ac962a 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -76,7 +76,7 @@ void br_port_carrier_check(struct net_bridge_port *p, bool *notified)
struct net_device *dev = p->dev;
struct net_bridge *br = p->br;
- if (!(p->flags & BR_ADMIN_COST) &&
+ if (!test_bit(BR_ADMIN_COST_BIT, &p->flags) &&
netif_running(dev) && netif_oper_up(dev))
p->path_cost = port_cost(dev);
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 28c1d3f7e22f..b29dc97b9ad8 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -340,7 +340,7 @@ int br_stp_set_path_cost(struct net_bridge_port *p, unsigned long path_cost)
path_cost > BR_MAX_PATH_COST)
return -ERANGE;
- p->flags |= BR_ADMIN_COST;
+ set_bit(BR_ADMIN_COST_BIT, &p->flags);
p->path_cost = path_cost;
br_configuration_update(p->br);
br_port_state_selection(p->br);