[PATCH 2/3] nilfs2: Deletion of an unnecessary check before the function call "iput"

From: Ryusuke Konishi
Date: Mon Dec 01 2014 - 11:50:54 EST

From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>

The iput() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@xxxxxxxxxxxxx>
fs/nilfs2/the_nilfs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c
index 9da25fe..69bd801 100644
--- a/fs/nilfs2/the_nilfs.c
+++ b/fs/nilfs2/the_nilfs.c
@@ -808,8 +808,7 @@ void nilfs_put_root(struct nilfs_root *root)
rb_erase(&root->rb_node, &nilfs->ns_cptree);
- if (root->ifile)
- iput(root->ifile);
+ iput(root->ifile);


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/