Skip to content

Commit 5bf33f0

Browse files
Mateusz Nosekgregkh
authored andcommitted
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: Mateusz Nosek <[email protected]> Acked-by: Tejun Heo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ef9ffc1 commit 5bf33f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/kernfs/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ void kernfs_activate(struct kernfs_node *kn)
12661266

12671267
pos = NULL;
12681268
while ((pos = kernfs_next_descendant_post(pos, kn))) {
1269-
if (!pos || (pos->flags & KERNFS_ACTIVATED))
1269+
if (pos->flags & KERNFS_ACTIVATED)
12701270
continue;
12711271

12721272
WARN_ON_ONCE(pos->parent && RB_EMPTY_NODE(&pos->rb));

0 commit comments

Comments
 (0)