Messages in this thread | | | Date | Mon, 21 Oct 2013 08:53:50 -0200 | Subject | Re: [PATCH] 9p: proper use of the 'name' variable | From | Geyslan Gregório Bem <> |
| |
2013/10/20 Eric Van Hensbergen <ericvh@gmail.com>: > I reckon we should probably just get rid of name if its not being used. I > doubt the indirection is going to hurt anything here. > > -eric >
Eric, you're right. Once that there's not assignment to name, the cycles are the same. I'll get rid of name var.
> > > On Sat, Sep 28, 2013 at 6:32 PM, Geyslan G. Bem <geyslan@gmail.com> wrote: >> >> The 'name' variable was assigned but never used. Hence puts its >> assignment to the top and makes proper use of its value. >> >> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com> >> --- >> fs/9p/vfs_inode_dotl.c | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c >> index 6803758..86b6944 100644 >> --- a/fs/9p/vfs_inode_dotl.c >> +++ b/fs/9p/vfs_inode_dotl.c >> @@ -772,8 +772,10 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct >> inode *dir, >> struct p9_fid *dfid, *oldfid; >> struct v9fs_session_info *v9ses; >> >> + name = (char *) dentry->d_name.name; >> + >> p9_debug(P9_DEBUG_VFS, "dir ino: %lu, old_name: %s, new_name: >> %s\n", >> - dir->i_ino, old_dentry->d_name.name, >> dentry->d_name.name); >> + dir->i_ino, old_dentry->d_name.name, name); >> >> v9ses = v9fs_inode2v9ses(dir); >> dir_dentry = dentry->d_parent; >> @@ -785,9 +787,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct >> inode *dir, >> if (IS_ERR(oldfid)) >> return PTR_ERR(oldfid); >> >> - name = (char *) dentry->d_name.name; >> - >> - err = p9_client_link(dfid, oldfid, (char *)dentry->d_name.name); >> + err = p9_client_link(dfid, oldfid, name); >> >> if (err < 0) { >> p9_debug(P9_DEBUG_VFS, "p9_client_link failed %d\n", err); >> -- >> 1.8.4 >> >
| |