[PATCH] afs: Fix bool initialization/comparison

Thomas Meyer thomas at m3y3r.de
Sat Oct 7 07:02:21 PDT 2017


Bool initializations should use true and false. Bool tests don't need
comparisons.

Signed-off-by: Thomas Meyer <thomas at m3y3r.de>
---

diff -u -p a/fs/afs/cache.c b/fs/afs/cache.c
--- a/fs/afs/cache.c
+++ b/fs/afs/cache.c
@@ -195,7 +195,7 @@ enum fscache_checkaux afs_vlocation_cach
 	 * VL record from the cache */
 	if (!vlocation->valid || vlocation->vldb.rtime == cvldb->rtime) {
 		memcpy((uint8_t *)&vlocation->vldb.nservers, buffer, dlen);
-		vlocation->valid = 1;
+		vlocation->valid = true;
 		_leave(" = SUCCESS [c->m]");
 		return FSCACHE_CHECKAUX_OKAY;
 	}
diff -u -p a/fs/afs/super.c b/fs/afs/super.c
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -211,7 +211,7 @@ static int afs_parse_options(struct afs_
 			break;
 
 		case afs_opt_rwpath:
-			params->rwpath = 1;
+			params->rwpath = true;
 			break;
 
 		case afs_opt_vol:
@@ -219,7 +219,7 @@ static int afs_parse_options(struct afs_
 			break;
 
 		case afs_opt_autocell:
-			params->autocell = 1;
+			params->autocell = true;
 			break;
 
 		default:
diff -u -p a/fs/afs/vlocation.c b/fs/afs/vlocation.c
--- a/fs/afs/vlocation.c
+++ b/fs/afs/vlocation.c
@@ -154,7 +154,7 @@ out:
 		printk(KERN_NOTICE "kAFS:"
 		       " Active volume no longer valid '%s'\n",
 		       vl->vldb.name);
-		vl->valid = 0;
+		vl->valid = false;
 		ret = -ENOMEDIUM;
 	}
 



More information about the linux-afs mailing list