Skip to content

Commit

Permalink
ncpfs: fix sparse warnings in ioctl.c
Browse files Browse the repository at this point in the history
In both cases, these inode variables arebeing used to test the
server's root inode against NULL.  Change them to s_inode.
fs/ncpfs/ioctl.c:391:18: warning: symbol 'inode' shadows an earlier one
fs/ncpfs/ioctl.c:264:28: originally declared here
fs/ncpfs/ioctl.c:441:17: warning: symbol 'inode' shadows an earlier one
fs/ncpfs/ioctl.c:264:28: originally declared here

In this case, we are about to return anyway, just reuse result.
fs/ncpfs/ioctl.c:521:8: warning: symbol 'result' shadows an earlier one
fs/ncpfs/ioctl.c:268:6: originally declared here

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: Petr Vandrovec <VANDROVE@vc.cvut.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Harvey Harrison authored and Linus Torvalds committed Apr 28, 2008
1 parent cdf8803 commit 305787e
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions fs/ncpfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,11 @@ static int __ncp_ioctl(struct inode *inode, struct file *filp,
struct dentry* dentry = inode->i_sb->s_root;

if (dentry) {
struct inode* inode = dentry->d_inode;
struct inode* s_inode = dentry->d_inode;

if (inode) {
sr.volNumber = NCP_FINFO(inode)->volNumber;
sr.dirEntNum = NCP_FINFO(inode)->dirEntNum;
if (s_inode) {
sr.volNumber = NCP_FINFO(s_inode)->volNumber;
sr.dirEntNum = NCP_FINFO(s_inode)->dirEntNum;
sr.namespace = server->name_space[sr.volNumber];
} else
DPRINTK("ncpfs: s_root->d_inode==NULL\n");
Expand Down Expand Up @@ -439,12 +439,12 @@ static int __ncp_ioctl(struct inode *inode, struct file *filp,
dentry = inode->i_sb->s_root;
server->root_setuped = 1;
if (dentry) {
struct inode* inode = dentry->d_inode;
struct inode* s_inode = dentry->d_inode;

if (inode) {
NCP_FINFO(inode)->volNumber = vnum;
NCP_FINFO(inode)->dirEntNum = de;
NCP_FINFO(inode)->DosDirNum = dosde;
NCP_FINFO(s_inode)->volNumber = vnum;
NCP_FINFO(s_inode)->dirEntNum = de;
NCP_FINFO(s_inode)->DosDirNum = dosde;
} else
DPRINTK("ncpfs: s_root->d_inode==NULL\n");
} else
Expand Down Expand Up @@ -519,7 +519,6 @@ static int __ncp_ioctl(struct inode *inode, struct file *filp,
}
{
struct ncp_lock_ioctl rqdata;
int result;

if (copy_from_user(&rqdata, argp, sizeof(rqdata)))
return -EFAULT;
Expand Down

0 comments on commit 305787e

Please sign in to comment.