Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1738239 > unrolled thread

[PATCH RESEND] fs/cachefiles: Remove unnecessary comparisons in bind.c

Started byChristos Gkekas <chris.gekas@gmail.com>
First post2017-09-24 20:00 +0200
Last post2017-09-24 20:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH RESEND] fs/cachefiles: Remove unnecessary comparisons in  bind.c Christos Gkekas <chris.gekas@gmail.com> - 2017-09-24 20:00 +0200

#1738239 — [PATCH RESEND] fs/cachefiles: Remove unnecessary comparisons in bind.c

FromChristos Gkekas <chris.gekas@gmail.com>
Date2017-09-24 20:00 +0200
Subject[PATCH RESEND] fs/cachefiles: Remove unnecessary comparisons in bind.c
Message-ID<utjm9-3fj-1@gated-at.bofh.it>
cache->fstop_percent and cache->bstop_percent are unsigned so they are
always >= 0. There is no point in asserting this.

Signed-off-by: Christos Gkekas <chris.gekas@gmail.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 d9f0010..105ac53 100644
--- a/fs/cachefiles/bind.c
+++ b/fs/cachefiles/bind.c
@@ -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);
 
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web