From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Dan Carpenter <error27@gmail.com>,
akpm@linux-foundation.org, Al Viro <viro@zeniv.linux.org.uk>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
James Morris <jmorris@namei.org>,
Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>,
"Helight.Xu" <helight.xu@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [patch] proc: cleanup: remove unused assignments
Date: Sun, 7 Mar 2010 22:13:08 -0600 [thread overview]
Message-ID: <20100308041308.GA25290@us.ibm.com> (raw)
In-Reply-To: <20100307195543.GB18616@redhat.com>
Quoting Oleg Nesterov (oleg@redhat.com):
> On 03/06, Dan Carpenter wrote:
> >
> > I removed 3 unused assignments. The first two get reset on the first
> > statement of their functions. For "err" in root.c we don't return an
> > error and we don't use the variable again.
>
> Looks like the obviously nice cleanup to me.
Yup. Particularly the last one might confuse someone...
Acked-by: Serge Hallyn <serue@us.ibm.com>
> > Signed-off-by: Dan Carpenter <error27@gmail.com>
> >
> > diff --git a/fs/proc/base.c b/fs/proc/base.c
> > index a731084..875d636 100644
> > --- a/fs/proc/base.c
> > +++ b/fs/proc/base.c
> > @@ -2434,7 +2434,7 @@ static struct dentry *proc_base_instantiate(struct inode *dir,
> > const struct pid_entry *p = ptr;
> > struct inode *inode;
> > struct proc_inode *ei;
> > - struct dentry *error = ERR_PTR(-EINVAL);
> > + struct dentry *error;
> >
> > /* Allocate the inode */
> > error = ERR_PTR(-ENOMEM);
> > @@ -2784,7 +2784,7 @@ out:
> >
> > struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
> > {
> > - struct dentry *result = ERR_PTR(-ENOENT);
> > + struct dentry *result;
> > struct task_struct *task;
> > unsigned tgid;
> > struct pid_namespace *ns;
> > diff --git a/fs/proc/root.c b/fs/proc/root.c
> > index 757c069..4258384 100644
> > --- a/fs/proc/root.c
> > +++ b/fs/proc/root.c
> > @@ -110,7 +110,6 @@ void __init proc_root_init(void)
> > if (err)
> > return;
> > proc_mnt = kern_mount_data(&proc_fs_type, &init_pid_ns);
> > - err = PTR_ERR(proc_mnt);
> > if (IS_ERR(proc_mnt)) {
> > unregister_filesystem(&proc_fs_type);
> > return;
next prev parent reply other threads:[~2010-03-08 4:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-06 11:19 [patch] proc: cleanup: remove unused assignments Dan Carpenter
2010-03-07 19:55 ` Oleg Nesterov
2010-03-08 4:13 ` Serge E. Hallyn [this message]
2010-03-09 3:25 ` KOSAKI Motohiro
2010-03-11 10:17 ` Helight.Xu
2010-03-11 10:29 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100308041308.GA25290@us.ibm.com \
--to=serue@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=error27@gmail.com \
--cc=helight.xu@gmail.com \
--cc=jmorris@namei.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=sukadev@linux.vnet.ibm.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox