提交 5bf33f04 编写于 作者: M Mateusz Nosek 提交者: Greg Kroah-Hartman

fs/kernfs/dir.c: Clean code by removing always true condition

Previously there was an additional check if variable pos is not null.
However, this check happens after entering while loop and only then,
which can happen only if pos is not null.
Therefore the additional check is redundant and can be removed.
Signed-off-by: NMateusz Nosek <mateusznosek0@gmail.com>
Acked-by: NTejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20191230191628.21099-1-mateusznosek0@gmail.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 ef9ffc1e
...@@ -1266,7 +1266,7 @@ void kernfs_activate(struct kernfs_node *kn) ...@@ -1266,7 +1266,7 @@ void kernfs_activate(struct kernfs_node *kn)
pos = NULL; pos = NULL;
while ((pos = kernfs_next_descendant_post(pos, kn))) { while ((pos = kernfs_next_descendant_post(pos, kn))) {
if (!pos || (pos->flags & KERNFS_ACTIVATED)) if (pos->flags & KERNFS_ACTIVATED)
continue; continue;
WARN_ON_ONCE(pos->parent && RB_EMPTY_NODE(&pos->rb)); WARN_ON_ONCE(pos->parent && RB_EMPTY_NODE(&pos->rb));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册