Skip to content

Commit

Permalink
fs: dcache: Use true and false for boolean values
Browse files Browse the repository at this point in the history
Return statements in functions returning bool should use true or false
instead of an integer value.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
GustavoARSilva authored and Al Viro committed Aug 5, 2018
1 parent f2df5da commit 7964410
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,16 +732,16 @@ static inline bool fast_dput(struct dentry *dentry)
if (dentry->d_lockref.count > 1) {
dentry->d_lockref.count--;
spin_unlock(&dentry->d_lock);
return 1;
return true;
}
return 0;
return false;
}

/*
* If we weren't the last ref, we're done.
*/
if (ret)
return 1;
return true;

/*
* Careful, careful. The reference count went down
Expand Down Expand Up @@ -770,7 +770,7 @@ static inline bool fast_dput(struct dentry *dentry)

/* Nothing to do? Dropping the reference was all we needed? */
if (d_flags == (DCACHE_REFERENCED | DCACHE_LRU_LIST) && !d_unhashed(dentry))
return 1;
return true;

/*
* Not the fast normal case? Get the lock. We've already decremented
Expand All @@ -787,7 +787,7 @@ static inline bool fast_dput(struct dentry *dentry)
*/
if (dentry->d_lockref.count) {
spin_unlock(&dentry->d_lock);
return 1;
return true;
}

/*
Expand All @@ -796,7 +796,7 @@ static inline bool fast_dput(struct dentry *dentry)
* set it to 1.
*/
dentry->d_lockref.count = 1;
return 0;
return false;
}


Expand Down

0 comments on commit 7964410

Please sign in to comment.