lkml.org 
[lkml]   [2014]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 1/1] nilfs2: Deletion of an unnecessary check before the function call "iput"
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Tue, 18 Nov 2014 14:41:27 +0100

    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@users.sourceforge.net>
    ---
    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)
    spin_lock(&nilfs->ns_cptree_lock);
    rb_erase(&root->rb_node, &nilfs->ns_cptree);
    spin_unlock(&nilfs->ns_cptree_lock);
    - if (root->ifile)
    - iput(root->ifile);
    + iput(root->ifile);

    kfree(root);
    }
    --
    2.1.3


    \
     
     \ /
      Last update: 2014-11-18 15:21    [W:5.102 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site