[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080708094109.03084e6a@infradead.org>
Date: Tue, 8 Jul 2008 09:41:09 -0700
From: Arjan van de Ven <arjan@...radead.org>
To: Arjan van de Ven <arjan@...radead.org>
Cc: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
mingo@...e.hu
Subject: [patch 3/17] Introduce WARN() usage in the kobject code
From: Arjan van de Ven <arjan@...ux.intel.com>
Now that WARN() exists, we can fold some of the printk's into it.
Signed-off-by: Arjan van de Ven <arjan@...ux.intel.com>
Cc: Greg KH <greg@...ah.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---
lib/kobject.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
Index: linux.trees.git/lib/kobject.c
===================================================================
--- linux.trees.git.orig/lib/kobject.c
+++ linux.trees.git/lib/kobject.c
@@ -215,9 +215,8 @@ static int kobject_add_internal(struct k
return -ENOENT;
if (!kobj->name || !kobj->name[0]) {
- pr_debug("kobject: (%p): attempted to be registered with empty "
+ WARN(1, "kobject: (%p): attempted to be registered with empty "
"name!\n", kobj);
- WARN_ON(1);
return -EINVAL;
}
@@ -627,12 +626,10 @@ static void kobject_release(struct kref
void kobject_put(struct kobject *kobj)
{
if (kobj) {
- if (!kobj->state_initialized) {
- printk(KERN_WARNING "kobject: '%s' (%p): is not "
+ if (!kobj->state_initialized)
+ WARN(1, KERN_WARNING "kobject: '%s' (%p): is not "
"initialized, yet kobject_put() is being "
"called.\n", kobject_name(kobj), kobj);
- WARN_ON(1);
- }
kref_put(&kobj->kref, kobject_release);
}
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists