public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: YueHaibing <yuehaibing@huawei.com>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>,
	<bridge@lists.linux-foundation.org>
Subject: Re: [PATCH net-next] bridge: use hlist_entry_safe
Date: Thu, 26 Apr 2018 08:54:13 -0700	[thread overview]
Message-ID: <20180426085413.53cad9ad@xeon-e3> (raw)
In-Reply-To: <20180426030705.6632-1-yuehaibing@huawei.com>

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>

  parent reply	other threads:[~2018-04-26 15:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26  3:07 [PATCH net-next] bridge: use hlist_entry_safe YueHaibing
2018-04-26 14:44 ` Nikolay Aleksandrov
2018-04-26 15:54 ` Stephen Hemminger [this message]
2018-04-27 17:21 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180426085413.53cad9ad@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox