Skip to content

Commit

Permalink
nilfs2: fix gcc warning at nilfs_checkpoint_is_mounted()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: David Binderman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
konis authored and torvalds committed Apr 17, 2015
1 parent 53a2c3b commit 3377f84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nilfs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 3377f84

Please sign in to comment.