summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorroel kluin <roel.kluin@gmail.com>2009-01-07 18:09:08 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-08 08:31:14 -0800
commitf15659628b43b27c20447c731456c39cbec973e9 (patch)
tree86f3a346ddf017881005413eb31a032ac8623d6d /fs
parent921d58c0e6992f74d3a48180604a298f115d2dee (diff)
downloadlwn-f15659628b43b27c20447c731456c39cbec973e9.tar.gz
lwn-f15659628b43b27c20447c731456c39cbec973e9.zip
romfs: romfs_iget() - unsigned ino >= 0 is always true
romfs_strnlen() returns int unsigned X >= 0 is always true [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: roel kluin <roel.kluin@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/romfs/inode.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/romfs/inode.c b/fs/romfs/inode.c
index c97d4c931715..98a232f7196b 100644
--- a/fs/romfs/inode.c
+++ b/fs/romfs/inode.c
@@ -490,7 +490,7 @@ static mode_t romfs_modemap[] =
static struct inode *
romfs_iget(struct super_block *sb, unsigned long ino)
{
- int nextfh;
+ int nextfh, ret;
struct romfs_inode ri;
struct inode *i;
@@ -526,11 +526,11 @@ romfs_iget(struct super_block *sb, unsigned long ino)
i->i_mtime.tv_nsec = i->i_atime.tv_nsec = i->i_ctime.tv_nsec = 0;
/* Precalculate the data offset */
- ino = romfs_strnlen(i, ino+ROMFH_SIZE, ROMFS_MAXFN);
- if (ino >= 0)
- ino = ((ROMFH_SIZE+ino+1+ROMFH_PAD)&ROMFH_MASK);
- else
- ino = 0;
+ ret = romfs_strnlen(i, ino + ROMFH_SIZE, ROMFS_MAXFN);
+ if (ret >= 0)
+ ino = (ROMFH_SIZE + ret + 1 + ROMFH_PAD) & ROMFH_MASK;
+ else
+ ino = 0;
ROMFS_I(i)->i_metasize = ino;
ROMFS_I(i)->i_dataoffset = ino+(i->i_ino&ROMFH_MASK);