* [PATCH net-next] bridge: use hlist_entry_safe
@ 2018-04-26 3:07 ` YueHaibing
0 siblings, 0 replies; 8+ messages in thread
From: YueHaibing @ 2018-04-26 3:07 UTC (permalink / raw)
To: stephen, davem; +Cc: netdev, bridge, YueHaibing
Use hlist_entry_safe() instead of open-coding it.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
net/bridge/br_forward.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index b4eed11..7a7fd67 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;
--
2.7.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Bridge] [PATCH net-next] bridge: use hlist_entry_safe
@ 2018-04-26 3:07 ` YueHaibing
0 siblings, 0 replies; 8+ messages in thread
From: YueHaibing @ 2018-04-26 3:07 UTC (permalink / raw)
To: stephen, davem; +Cc: netdev, bridge, YueHaibing
Use hlist_entry_safe() instead of open-coding it.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
net/bridge/br_forward.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index b4eed11..7a7fd67 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;
--
2.7.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next] bridge: use hlist_entry_safe
2018-04-26 3:07 ` [Bridge] " YueHaibing
@ 2018-04-26 14:44 ` Nikolay Aleksandrov
-1 siblings, 0 replies; 8+ messages in thread
From: Nikolay Aleksandrov @ 2018-04-26 14:44 UTC (permalink / raw)
To: YueHaibing, stephen, davem; +Cc: netdev, bridge
On 26/04/18 06:07, YueHaibing wrote:
> Use hlist_entry_safe() instead of open-coding it.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> net/bridge/br_forward.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
> index b4eed11..7a7fd67 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;
>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Bridge] [PATCH net-next] bridge: use hlist_entry_safe
@ 2018-04-26 14:44 ` Nikolay Aleksandrov
0 siblings, 0 replies; 8+ messages in thread
From: Nikolay Aleksandrov @ 2018-04-26 14:44 UTC (permalink / raw)
To: YueHaibing, stephen, davem; +Cc: netdev, bridge
On 26/04/18 06:07, YueHaibing wrote:
> Use hlist_entry_safe() instead of open-coding it.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> net/bridge/br_forward.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
> index b4eed11..7a7fd67 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;
>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next] bridge: use hlist_entry_safe
2018-04-26 3:07 ` [Bridge] " YueHaibing
@ 2018-04-26 15:54 ` Stephen Hemminger
-1 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2018-04-26 15:54 UTC (permalink / raw)
To: YueHaibing; +Cc: davem, netdev, bridge
On Thu, 26 Apr 2018 11:07:05 +0800
YueHaibing <yuehaibing@huawei.com> wrote:
> Use hlist_entry_safe() instead of open-coding it.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> net/bridge/br_forward.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
> index b4eed11..7a7fd67 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;
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Bridge] [PATCH net-next] bridge: use hlist_entry_safe
@ 2018-04-26 15:54 ` Stephen Hemminger
0 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2018-04-26 15:54 UTC (permalink / raw)
To: YueHaibing; +Cc: netdev, bridge, davem
On Thu, 26 Apr 2018 11:07:05 +0800
YueHaibing <yuehaibing@huawei.com> wrote:
> Use hlist_entry_safe() instead of open-coding it.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> net/bridge/br_forward.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
> index b4eed11..7a7fd67 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;
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next] bridge: use hlist_entry_safe
2018-04-26 3:07 ` [Bridge] " YueHaibing
@ 2018-04-27 17:21 ` David Miller
-1 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2018-04-27 17:21 UTC (permalink / raw)
To: yuehaibing; +Cc: stephen, netdev, bridge
From: YueHaibing <yuehaibing@huawei.com>
Date: Thu, 26 Apr 2018 11:07:05 +0800
> Use hlist_entry_safe() instead of open-coding it.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Bridge] [PATCH net-next] bridge: use hlist_entry_safe
@ 2018-04-27 17:21 ` David Miller
0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2018-04-27 17:21 UTC (permalink / raw)
To: yuehaibing; +Cc: netdev, bridge
From: YueHaibing <yuehaibing@huawei.com>
Date: Thu, 26 Apr 2018 11:07:05 +0800
> Use hlist_entry_safe() instead of open-coding it.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-04-27 17:21 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26 3:07 [PATCH net-next] bridge: use hlist_entry_safe YueHaibing
2018-04-26 3:07 ` [Bridge] " YueHaibing
2018-04-26 14:44 ` Nikolay Aleksandrov
2018-04-26 14:44 ` [Bridge] " Nikolay Aleksandrov
2018-04-26 15:54 ` Stephen Hemminger
2018-04-26 15:54 ` [Bridge] " Stephen Hemminger
2018-04-27 17:21 ` David Miller
2018-04-27 17:21 ` [Bridge] " David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.