netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Hongbo Li <lihongbo22@huawei.com>
Cc: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, jmaloy@redhat.com,
	ying.xue@windriver.com, kadlec@netfilter.org,
	netdev@vger.kernel.org, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH net-next 3/5] net/netfilter: make use of the helper macro LIST_HEAD()
Date: Tue, 27 Aug 2024 18:15:19 +0200	[thread overview]
Message-ID: <Zs37l04h3bsK8LIE@calendula> (raw)
In-Reply-To: <20240827100407.3914090-4-lihongbo22@huawei.com>

Hi,

On Tue, Aug 27, 2024 at 06:04:05PM +0800, Hongbo Li wrote:
> list_head can be initialized automatically with LIST_HEAD()
> instead of calling INIT_LIST_HEAD(). Here we can simplify
> the code.
> 
> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
> ---
>  net/netfilter/core.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/net/netfilter/core.c b/net/netfilter/core.c
> index b00fc285b334..93642fcd379c 100644
> --- a/net/netfilter/core.c
> +++ b/net/netfilter/core.c
> @@ -655,10 +655,8 @@ void nf_hook_slow_list(struct list_head *head, struct nf_hook_state *state,
>  		       const struct nf_hook_entries *e)
>  {
>  	struct sk_buff *skb, *next;
> -	struct list_head sublist;
>  	int ret;
> -
> -	INIT_LIST_HEAD(&sublist);
> +	LIST_HEAD(sublist);

comestic:

  	struct sk_buff *skb, *next;
	LIST_HEAD(sublist);          <- here
  	int ret;

I think this should be included in the variable declaration area at
the beginning of this function.

>  	list_for_each_entry_safe(skb, next, head, list) {
>  		skb_list_del_init(skb);
> -- 
> 2.34.1
> 
> 

  reply	other threads:[~2024-08-27 16:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 10:04 [PATCH net-next 0/5] make use of the helper macro LIST_HEAD() Hongbo Li
2024-08-27 10:04 ` [PATCH net-next 1/5] net/ipv4: " Hongbo Li
2024-08-27 10:04 ` [PATCH net-next 2/5] net/tipc: " Hongbo Li
2024-08-27 16:57   ` Simon Horman
2024-08-30  1:17     ` Hongbo Li
2024-08-27 10:04 ` [PATCH net-next 3/5] net/netfilter: " Hongbo Li
2024-08-27 16:15   ` Pablo Neira Ayuso [this message]
2024-08-28  1:35     ` Hongbo Li
2024-08-28  6:52       ` Pablo Neira Ayuso
2024-08-27 10:04 ` [PATCH net-next 4/5] net/ipv6: " Hongbo Li
2024-08-27 10:04 ` [PATCH net-next 5/5] net/core: " Hongbo Li

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=Zs37l04h3bsK8LIE@calendula \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=jmaloy@redhat.com \
    --cc=kadlec@netfilter.org \
    --cc=kuba@kernel.org \
    --cc=lihongbo22@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ying.xue@windriver.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;
as well as URLs for NNTP newsgroup(s).