nilfs2: fix gcc warning at nilfs_checkpoint_is_mounted()
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Thu, 16 Apr 2015 19:46:45 +0000 (12:46 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 17 Apr 2015 13:04:04 +0000 (09:04 -0400)
Fix the following build warning:

 fs/nilfs2/super.c: In function 'nilfs_checkpoint_is_mounted':
 fs/nilfs2/super.c:1023:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
   if (cno < 0 || cno > nilfs->ns_cno)
           ^

This warning indicates that the comparision "cno < 0" is useless because
variable "cno" has an unsigned integer type "__u64".

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/nilfs2/super.c

index 5bc2a1cf73c35311013a3e97636f5366ee131a8e..c1725f20a9d1d4149ebb7b369caa9c47d951758e 100644 (file)
@@ -1020,7 +1020,7 @@ int nilfs_checkpoint_is_mounted(struct super_block *sb, __u64 cno)
        struct dentry *dentry;
        int ret;
 
-       if (cno < 0 || cno > nilfs->ns_cno)
+       if (cno > nilfs->ns_cno)
                return false;
 
        if (cno >= nilfs_last_cno(nilfs))