From: greg <gregkh@linuxfoundation.org>
To: yan <clouds.yan@gmail.com>
Cc: kernel <linux-kernel@vger.kernel.org>, message <message.get@gmail.com>
Subject: Re: [PATCH][Trivial] lib/kobject.c: Remove redundant check in populate_dir
Date: Mon, 23 Apr 2012 13:43:22 -0700 [thread overview]
Message-ID: <20120423204322.GE13075@kroah.com> (raw)
In-Reply-To: <1335003508.2188.44.camel@yan>
On Sat, Apr 21, 2012 at 06:18:25PM +0800, yan wrote:
> create_dir will call sysfs_create_dir and then populate_dir.
> If ktype of kobject is null, sysfs_craete_dir will lead to
> oops first. There is no need to check ktype in populate_dir.
>
> Signed-off-by: Yan Hong <clouds.yan@gmail.com>
> ---
> lib/kobject.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/lib/kobject.c b/lib/kobject.c
> index bc05922..85d5e9b 100644
> --- a/lib/kobject.c
> +++ b/lib/kobject.c
> @@ -34,7 +34,7 @@ static int populate_dir(struct kobject *kobj)
> int error = 0;
> int i;
>
> - if (t && t->default_attrs) {
> + if (t->default_attrs) {
I don't know, I think I'd like to keep this check for now, as it was put
there for a reason. Yes, it's a reason lost to the sands of time, but
is it costing us anything if it is still there?
greg k-h
prev parent reply other threads:[~2012-04-23 20:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-21 10:18 yan
2012-04-23 20:43 ` greg [this message]
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=20120423204322.GE13075@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=clouds.yan@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=message.get@gmail.com \
/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
Powered by JetHome