Skip to contentSkip to conversation

fs: dcache: Use true and false for boolean values

PATCH New Gustavo A. R. Silva 1 participant 1 message Aug 2, 2018 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: dcache: Use true and false for boolean values

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.

---
 fs/dcache.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
fs/dcache.c +6 -6
index b928915..8c07ab1 100644
@@ -733,16 +733,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
@@ -771,7 +771,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
@@ -788,7 +788,7 @@ static inline bool fast_dput(struct dentry *dentry)
 	 */
 	if (dentry->d_lockref.count) {
 		spin_unlock(&dentry->d_lock);
-		return 1;
+		return true;
 	}
 
 	/*
@@ -797,7 +797,7 @@ static inline bool fast_dput(struct dentry *dentry)
 	 * set it to 1.
 	 */
 	dentry->d_lockref.count = 1;
-	return 0;
+	return false;
 }
 
 
Signature · 1 line
2.7.4