From: Eric Dumazet Date: Thu, 4 Jun 2026 14:13:36 +0000 (+0000) Subject: bridge: use BR_ADMIN_COST_BIT X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2013ebb9b3819dd74a9b26634e49453046b63037;p=thirdparty%2Flinux.git bridge: use BR_ADMIN_COST_BIT Use set_bit() and test_bit() lockless functions. Signed-off-by: Eric Dumazet Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Link: https://patch.msgid.link/20260604141343.2124500-5-edumazet@google.com Signed-off-by: Jakub Kicinski --- diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 080e61d2414a2..630ca7ac962ac 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 28c1d3f7e22f6..b29dc97b9ad8a 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);