Commit ac664f02 authored by Mika Kukkonen's avatar Mika Kukkonen Committed by Linus Torvalds

[PATCH] Fix sparse warnings in fs/udf/*

  CHECK   fs/udf/dir.c
fs/udf/dir.c:240:13: warning: expected lvalue for member dereference
[...]
  CHECK   fs/udf/namei.c
fs/udf/namei.c:872:6: warning: expected lvalue for member dereference
fs/udf/namei.c:916:6: warning: expected lvalue for member dereference
fs/udf/namei.c:1189:14: warning: expected lvalue for member dereference
fs/udf/namei.c:1234:7: warning: expected lvalue for member dereference
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 12abcba2
...@@ -237,7 +237,9 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d ...@@ -237,7 +237,9 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d
} }
else else
{ {
iblock = udf_get_lb_pblock(dir->i_sb, lelb_to_cpu(cfi.icb.extLocation), 0); lb_addr tloc = lelb_to_cpu(cfi.icb.extLocation);
iblock = udf_get_lb_pblock(dir->i_sb, tloc, 0);
flen = udf_get_filename(dir->i_sb, nameptr, fname, lfi); flen = udf_get_filename(dir->i_sb, nameptr, fname, lfi);
dt_type = DT_UNKNOWN; dt_type = DT_UNKNOWN;
} }
......
...@@ -861,6 +861,7 @@ static int udf_rmdir(struct inode * dir, struct dentry * dentry) ...@@ -861,6 +861,7 @@ static int udf_rmdir(struct inode * dir, struct dentry * dentry)
struct inode * inode = dentry->d_inode; struct inode * inode = dentry->d_inode;
struct udf_fileident_bh fibh; struct udf_fileident_bh fibh;
struct fileIdentDesc *fi, cfi; struct fileIdentDesc *fi, cfi;
lb_addr tloc;
retval = -ENOENT; retval = -ENOENT;
lock_kernel(); lock_kernel();
...@@ -869,7 +870,8 @@ static int udf_rmdir(struct inode * dir, struct dentry * dentry) ...@@ -869,7 +870,8 @@ static int udf_rmdir(struct inode * dir, struct dentry * dentry)
goto out; goto out;
retval = -EIO; retval = -EIO;
if (udf_get_lb_pblock(dir->i_sb, lelb_to_cpu(cfi.icb.extLocation), 0) != inode->i_ino) tloc = lelb_to_cpu(cfi.icb.extLocation);
if (udf_get_lb_pblock(dir->i_sb, tloc, 0) != inode->i_ino)
goto end_rmdir; goto end_rmdir;
retval = -ENOTEMPTY; retval = -ENOTEMPTY;
if (!empty_dir(inode)) if (!empty_dir(inode))
...@@ -904,6 +906,7 @@ static int udf_unlink(struct inode * dir, struct dentry * dentry) ...@@ -904,6 +906,7 @@ static int udf_unlink(struct inode * dir, struct dentry * dentry)
struct udf_fileident_bh fibh; struct udf_fileident_bh fibh;
struct fileIdentDesc *fi; struct fileIdentDesc *fi;
struct fileIdentDesc cfi; struct fileIdentDesc cfi;
lb_addr tloc;
retval = -ENOENT; retval = -ENOENT;
lock_kernel(); lock_kernel();
...@@ -912,12 +915,9 @@ static int udf_unlink(struct inode * dir, struct dentry * dentry) ...@@ -912,12 +915,9 @@ static int udf_unlink(struct inode * dir, struct dentry * dentry)
goto out; goto out;
retval = -EIO; retval = -EIO;
tloc = lelb_to_cpu(cfi.icb.extLocation);
if (udf_get_lb_pblock(dir->i_sb, lelb_to_cpu(cfi.icb.extLocation), 0) != if (udf_get_lb_pblock(dir->i_sb, tloc, 0) != inode->i_ino)
inode->i_ino)
{
goto end_unlink; goto end_unlink;
}
if (!inode->i_nlink) if (!inode->i_nlink)
{ {
...@@ -1178,6 +1178,7 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry, ...@@ -1178,6 +1178,7 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
struct fileIdentDesc *ofi = NULL, *nfi = NULL, *dir_fi = NULL, ocfi, ncfi; struct fileIdentDesc *ofi = NULL, *nfi = NULL, *dir_fi = NULL, ocfi, ncfi;
struct buffer_head *dir_bh = NULL; struct buffer_head *dir_bh = NULL;
int retval = -ENOENT; int retval = -ENOENT;
lb_addr tloc;
lock_kernel(); lock_kernel();
if ((ofi = udf_find_entry(old_dir, old_dentry, &ofibh, &ocfi))) if ((ofi = udf_find_entry(old_dir, old_dentry, &ofibh, &ocfi)))
...@@ -1186,11 +1187,10 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry, ...@@ -1186,11 +1187,10 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
udf_release_data(ofibh.ebh); udf_release_data(ofibh.ebh);
udf_release_data(ofibh.sbh); udf_release_data(ofibh.sbh);
} }
if (!ofi || udf_get_lb_pblock(old_dir->i_sb, lelb_to_cpu(ocfi.icb.extLocation), 0) != tloc = lelb_to_cpu(ocfi.icb.extLocation);
old_inode->i_ino) if (!ofi || udf_get_lb_pblock(old_dir->i_sb, tloc, 0)
{ != old_inode->i_ino)
goto end_rename; goto end_rename;
}
nfi = udf_find_entry(new_dir, new_dentry, &nfibh, &ncfi); nfi = udf_find_entry(new_dir, new_dentry, &nfibh, &ncfi);
if (nfi) if (nfi)
...@@ -1231,11 +1231,11 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry, ...@@ -1231,11 +1231,11 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
} }
if (!dir_fi) if (!dir_fi)
goto end_rename; goto end_rename;
if (udf_get_lb_pblock(old_inode->i_sb, cpu_to_lelb(dir_fi->icb.extLocation), 0) != tloc = cpu_to_lelb(dir_fi->icb.extLocation);
old_dir->i_ino) if (udf_get_lb_pblock(old_inode->i_sb, tloc, 0)
{ != old_dir->i_ino)
goto end_rename; goto end_rename;
}
retval = -EMLINK; retval = -EMLINK;
if (!new_inode && new_dir->i_nlink >= (256<<sizeof(new_dir->i_nlink))-1) if (!new_inode && new_dir->i_nlink >= (256<<sizeof(new_dir->i_nlink))-1)
goto end_rename; goto end_rename;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment