From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: linux-kernel@vger.kernel.org,
Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Subject: Re: [PATCH 1/2] kobject: Add kobject_initialized() function
Date: Wed, 29 Oct 2014 10:43:20 +0800 [thread overview]
Message-ID: <20141029024320.GB7338@kroah.com> (raw)
In-Reply-To: <1414510008-7262-1-git-send-email-tomeu.vizoso@collabora.com>
On Tue, Oct 28, 2014 at 04:26:47PM +0100, Tomeu Vizoso wrote:
> To be used by users of kobject to tell when one hasn't been initialized yet.
>
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> ---
> include/linux/kobject.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/linux/kobject.h b/include/linux/kobject.h
> index 2d61b90..6bb5a92 100644
> --- a/include/linux/kobject.h
> +++ b/include/linux/kobject.h
> @@ -88,6 +88,11 @@ static inline const char *kobject_name(const struct kobject *kobj)
> return kobj->name;
> }
>
> +static inline bool kobject_initialized(const struct kobject *kobj)
> +{
> + return kobj->state_initialized;
> +}
Ick, no. Why would you ever need this? You "own" the kobject, and you
better know if you initialized it or not. If not, you should fix your
use of a kobject.
And why are you even using a kobject at all?
greg k-h
prev parent reply other threads:[~2014-10-29 2:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-28 15:26 [PATCH 1/2] kobject: Add kobject_initialized() function Tomeu Vizoso
2014-10-28 15:26 ` [PATCH 2/2] cpufreq: Guard against not-yet-initialized policies in cpufreq_cpu_get Tomeu Vizoso
2014-10-29 2:44 ` Greg KH
2014-10-29 15:45 ` [PATCH v2] cpufreq: Guard against not-yet-initialized policies in cpufreq_cpu_get() Tomeu Vizoso
2014-10-29 21:24 ` Rafael J. Wysocki
2014-10-31 8:53 ` Tomeu Vizoso
2014-11-10 9:54 ` Viresh Kumar
2014-10-29 2:43 ` Greg Kroah-Hartman [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=20141029024320.GB7338@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=javier.martinez@collabora.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=tomeu.vizoso@collabora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.