mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-22 07:04:39 +00:00
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>
This commit is contained in:
parent
921d58c0e6
commit
f15659628b
1 changed files with 6 additions and 6 deletions
|
@ -490,7 +490,7 @@ static mode_t romfs_modemap[] =
|
||||||
static struct inode *
|
static struct inode *
|
||||||
romfs_iget(struct super_block *sb, unsigned long ino)
|
romfs_iget(struct super_block *sb, unsigned long ino)
|
||||||
{
|
{
|
||||||
int nextfh;
|
int nextfh, ret;
|
||||||
struct romfs_inode ri;
|
struct romfs_inode ri;
|
||||||
struct inode *i;
|
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;
|
i->i_mtime.tv_nsec = i->i_atime.tv_nsec = i->i_ctime.tv_nsec = 0;
|
||||||
|
|
||||||
/* Precalculate the data offset */
|
/* Precalculate the data offset */
|
||||||
ino = romfs_strnlen(i, ino+ROMFH_SIZE, ROMFS_MAXFN);
|
ret = romfs_strnlen(i, ino + ROMFH_SIZE, ROMFS_MAXFN);
|
||||||
if (ino >= 0)
|
if (ret >= 0)
|
||||||
ino = ((ROMFH_SIZE+ino+1+ROMFH_PAD)&ROMFH_MASK);
|
ino = (ROMFH_SIZE + ret + 1 + ROMFH_PAD) & ROMFH_MASK;
|
||||||
else
|
else
|
||||||
ino = 0;
|
ino = 0;
|
||||||
|
|
||||||
ROMFS_I(i)->i_metasize = ino;
|
ROMFS_I(i)->i_metasize = ino;
|
||||||
ROMFS_I(i)->i_dataoffset = ino+(i->i_ino&ROMFH_MASK);
|
ROMFS_I(i)->i_dataoffset = ino+(i->i_ino&ROMFH_MASK);
|
||||||
|
|
Loading…
Add table
Reference in a new issue