]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: replace usage of found with dedicated list iterator variable
authorJakob Koschel <jakobkoschel@gmail.com>
Fri, 29 Apr 2022 21:37:57 +0000 (14:37 -0700)
committerakpm <akpm@linux-foundation.org>
Fri, 29 Apr 2022 21:37:57 +0000 (14:37 -0700)
commit03285e7db889750758dc0639b5be677ffcff9aa3
tree891ceea91edba950733a1632529dc873447165d1
parent540963dd3a94996136cc254deb3741ad8cdae693
ocfs2: replace usage of found with dedicated list iterator variable

To move the list iterator variable into the list_for_each_entry_*() macro
in the future it should be avoided to use the list iterator variable after
the loop body.

To *never* use the list iterator variable after the loop it was concluded
to use a separate iterator variable instead of a found boolean [1].

This removes the need to use a found variable and simply checking if the
variable was set, can determine if the break/goto was hit.

Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/
Link: https://lkml.kernel.org/r/20220324071650.61168-1-jakobkoschel@gmail.com
Signed-off-by: Jakob Koschel <jakobkoschel@gmail.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/dlm/dlmunlock.c
fs/ocfs2/quota_local.c