summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-04-26 11:07:05 +0800
committerDavid S. Miller <davem@davemloft.net>2018-04-27 13:20:48 -0400
commitd8fb1648fcf2d5ded71239fc16d69c447af6f814 (patch)
tree8e359212c6c7d7f45dd163488032941fc6b7dc78
parent1e3ac2012d727b42066df18eba472d47aaea9379 (diff)
downloadlinux-d8fb1648fcf2d5ded71239fc16d69c447af6f814.tar.gz
linux-d8fb1648fcf2d5ded71239fc16d69c447af6f814.tar.bz2
linux-d8fb1648fcf2d5ded71239fc16d69c447af6f814.zip
bridge: use hlist_entry_safe
Use hlist_entry_safe() instead of open-coding it. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/bridge/br_forward.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index b4eed113d2ec..7a7fd672ccf2 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -274,8 +274,7 @@ void br_multicast_flood(struct net_bridge_mdb_entry *mdst,
struct net_bridge_port *port, *lport, *rport;
lport = p ? p->port : NULL;
- rport = rp ? hlist_entry(rp, struct net_bridge_port, rlist) :
- NULL;
+ rport = hlist_entry_safe(rp, struct net_bridge_port, rlist);
if ((unsigned long)lport > (unsigned long)rport) {
port = lport;