fs/kernfs/dir.c: Clean code by removing always true condition
PATCH 1/1 fs/kernfs/dir.c: Clean code by removing always true condition
From: Mateusz Nosek <[email protected]>
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.
--- fs/kernfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/kernfs/dir.c +1 -1
@@ -1266,7 +1266,7 @@ void kernfs_activate(struct kernfs_node *kn) pos =NULL ;while ((pos =kernfs_next_descendant_post (pos, kn))) { -if (!pos || (pos->flags &KERNFS_ACTIVATED )) +if (pos->flags &KERNFS_ACTIVATED )continue ;WARN_ON_ONCE (pos->parent &&RB_EMPTY_NODE (&pos->rb));
Signature · 1 line
2.17.1
Quoted 8 lines · On Mon, Dec 30, 2019 at 08:16:28PM +0100, [email protected] wrote:
From: Mateusz Nosek <[email protected]>
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]>
Greg, can you please route this one?
Thanks.
Signature · 1 line
tejun
Greg KH
maintainerQuoted 8 lines · Tejun Heo
Quoted 7 lines · On Mon, Dec 30, 2019 at 08:16:28PM +0100, [email protected] wrote:
From: Mateusz Nosek <[email protected]>
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.
Quoted 5 lines
Quoted 1 line
Signed-off-by Mateusz Nosek <[email protected]>Acked-by Tejun Heo <[email protected]>Greg, can you please route this one?
Sure, will do, thanks.
greg k-h