GFS2: Deletion of unnecessary checks before two function calls
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 18 Nov 2014 10:31:23 +0000 (11:31 +0100)
committerSteven Whitehouse <swhiteho@redhat.com>
Tue, 18 Nov 2014 10:57:58 +0000 (10:57 +0000)
The functions iput() and put_pid() test whether their argument is NULL
and then return 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>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/glock.c

index 8f0c19d1d9439e3827ffd649e7f7d43f096afc89..a23524aa3eac34a33902e0a9bd1304936d7017fc 100644 (file)
@@ -836,8 +836,7 @@ void gfs2_holder_reinit(unsigned int state, unsigned flags, struct gfs2_holder *
        gh->gh_flags = flags;
        gh->gh_iflags = 0;
        gh->gh_ip = _RET_IP_;
-       if (gh->gh_owner_pid)
-               put_pid(gh->gh_owner_pid);
+       put_pid(gh->gh_owner_pid);
        gh->gh_owner_pid = get_pid(task_pid(current));
 }