Skip to contentSkip to conversation

fs/cachefiles: Remove unnecessary comparisons in bind.c

PATCH Superseded Christos Gkekas 1 participant 1 message Sep 9, 2017 Cachefiles: fs-cache backend for caching on mounted filesystems

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/cachefiles: Remove unnecessary comparisons in bind.c

cache->fstop_percent and cache->bstop_percent are unsigned so they are always >= 0. There is no point in asserting this.

---
 fs/cachefiles/bind.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/cachefiles/bind.c +2 -4
index d9f0010..105ac53 100644
@@ -40,13 +40,11 @@ int cachefiles_daemon_bind(struct cachefiles_cache *cache, char *args)
 	       args);
 
 	/* start by checking things over */
-	ASSERT(cache->fstop_percent >= 0 &&
-	       cache->fstop_percent < cache->fcull_percent &&
+	ASSERT(cache->fstop_percent < cache->fcull_percent &&
 	       cache->fcull_percent < cache->frun_percent &&
 	       cache->frun_percent  < 100);
 
-	ASSERT(cache->bstop_percent >= 0 &&
-	       cache->bstop_percent < cache->bcull_percent &&
+	ASSERT(cache->bstop_percent < cache->bcull_percent &&
 	       cache->bcull_percent < cache->brun_percent &&
 	       cache->brun_percent  < 100);
 
Signature · 1 line
2.7.4