* [PATCH] mbcache: remove redundant comparison of unsigned long with < 0
@ 2017-11-29 18:58 Colin King
0 siblings, 0 replies; only message in thread
From: Colin King @ 2017-11-29 18:58 UTC (permalink / raw)
To: Alexander Viro, linux-fsdevel; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The comparison of c_entry_count < 0 is never true because c_entry_count
is an unsigned long and hence cannot be negative. Hence the 'unlikely'
comparison is redundant and can be removed.
Detected by CoverityScan, CID#1462298 ("Macro compares unsigned to 0")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
fs/mbcache.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/fs/mbcache.c b/fs/mbcache.c
index b8b8b9ced9f8..d818fd236787 100644
--- a/fs/mbcache.c
+++ b/fs/mbcache.c
@@ -269,9 +269,6 @@ static unsigned long mb_cache_count(struct shrinker *shrink,
struct mb_cache *cache = container_of(shrink, struct mb_cache,
c_shrink);
- /* Unlikely, but not impossible */
- if (unlikely(cache->c_entry_count < 0))
- return 0;
return cache->c_entry_count;
}
--
2.14.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-11-29 18:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-29 18:58 [PATCH] mbcache: remove redundant comparison of unsigned long with < 0 Colin King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).