lkml.org 
[lkml]   [2022]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] netfilter: nf_tables: replace unnecessary use of list_for_each_entry_continue()
Jakob Koschel <jakobkoschel@gmail.com> wrote:
> Since there is no way for the previous list_for_each_entry() to exit
> early, this call to list_for_each_entry_continue() is always guaranteed
> to start with the first element of the list and can therefore be
> replaced with a call to list_for_each_entry().
>
> In preparation to limit the scope of the list iterator to the list
> traversal loop, the list iterator variable 'rule' should not be used
> past the loop.
>
> Signed-off-by: Jakob Koschel <jakobkoschel@gmail.com>
>
> - list_for_each_entry_continue(rule, &chain->rules, list) {
> + list_for_each_entry(rule, &chain->rules, list) {
> if (!nft_is_active_next(net, rule))
> continue;

You could also replace the first entry_continue and get rid of the
preceeding
rule = list_entry().

\
 
 \ /
  Last update: 2022-03-20 01:46    [W:0.063 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site