[Linux-cachefs] [PATCH 1/2] fs/cachefiles/bind.c: remove always true comparison

zhengbin zhengbin13 at huawei.com
Tue Sep 3 01:42:56 UTC 2019


Fixes gcc warning:

fs/cachefiles/bind.c:39:30: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
fs/cachefiles/bind.c:44:30: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]

Reported-by: Hulk Robot <hulkci at huawei.com>
Signed-off-by: zhengbin <zhengbin13 at huawei.com>
---
 fs/cachefiles/bind.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/cachefiles/bind.c b/fs/cachefiles/bind.c
index dfb14db..5c818ba 100644
--- a/fs/cachefiles/bind.c
+++ b/fs/cachefiles/bind.c
@@ -36,13 +36,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);

--
2.7.4




More information about the Linux-cachefs mailing list