All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jiri Kosina <trivial@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>, linux-kernel@vger.kernel.org
Subject: [PATCH 33/39] lib: Update WARN uses
Date: Sat, 30 Oct 2010 14:08:50 -0700	[thread overview]
Message-ID: <4c14c8dfad71a552d1d927aec07fac0d40ba81e4.1288471898.git.joe@perches.com> (raw)
In-Reply-To: <cover.1288471897.git.joe@perches.com>

Coalesce long formats.
Align arguments.
Remove KERN_<level>.
Use %s, __func__

Signed-off-by: Joe Perches <joe@perches.com>
---
 lib/debugobjects.c   |   21 ++++++++++-----------
 lib/iomap.c          |    2 +-
 lib/kobject.c        |    9 ++++-----
 lib/kobject_uevent.c |    4 ++--
 lib/list_debug.c     |   24 ++++++++++--------------
 lib/plist.c          |   12 ++++++------
 6 files changed, 33 insertions(+), 39 deletions(-)

diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index deebcc5..f9f33fe 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -253,10 +253,9 @@ static void debug_print_object(struct debug_obj *obj, char *msg)
 
 	if (limit < 5 && obj->descr != descr_test) {
 		limit++;
-		WARN(1, KERN_ERR "ODEBUG: %s %s (active state %u) "
-				 "object type: %s\n",
-			msg, obj_states[obj->state], obj->astate,
-			obj->descr->name);
+		WARN(1, "ODEBUG: %s %s (active state %u) object type: %s\n",
+		     msg, obj_states[obj->state], obj->astate,
+		     obj->descr->name);
 	}
 	debug_objects_warnings++;
 }
@@ -841,22 +840,22 @@ check_results(void *addr, enum debug_obj_state state, int fixups, int warnings)
 
 	obj = lookup_object(addr, db);
 	if (!obj && state != ODEBUG_STATE_NONE) {
-		WARN(1, KERN_ERR "ODEBUG: selftest object not found\n");
+		WARN(1, "ODEBUG: selftest object not found\n");
 		goto out;
 	}
 	if (obj && obj->state != state) {
-		WARN(1, KERN_ERR "ODEBUG: selftest wrong state: %d != %d\n",
-		       obj->state, state);
+		WARN(1, "ODEBUG: selftest wrong state: %d != %d\n",
+		     obj->state, state);
 		goto out;
 	}
 	if (fixups != debug_objects_fixups) {
-		WARN(1, KERN_ERR "ODEBUG: selftest fixups failed %d != %d\n",
-		       fixups, debug_objects_fixups);
+		WARN(1, "ODEBUG: selftest fixups failed %d != %d\n",
+		     fixups, debug_objects_fixups);
 		goto out;
 	}
 	if (warnings != debug_objects_warnings) {
-		WARN(1, KERN_ERR "ODEBUG: selftest warnings failed %d != %d\n",
-		       warnings, debug_objects_warnings);
+		WARN(1, "ODEBUG: selftest warnings failed %d != %d\n",
+		     warnings, debug_objects_warnings);
 		goto out;
 	}
 	res = 0;
diff --git a/lib/iomap.c b/lib/iomap.c
index d322293..08b4c8d 100644
--- a/lib/iomap.c
+++ b/lib/iomap.c
@@ -40,7 +40,7 @@ static void bad_io_access(unsigned long port, const char *access)
 	static int count = 10;
 	if (count) {
 		count--;
-		WARN(1, KERN_ERR "Bad IO access at port %#lx (%s)\n", port, access);
+		WARN(1, "Bad IO access at port %#lx (%s)\n", port, access);
 	}
 }
 
diff --git a/lib/kobject.c b/lib/kobject.c
index 82dc34c..26b808e 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -164,8 +164,8 @@ static int kobject_add_internal(struct kobject *kobj)
 		return -ENOENT;
 
 	if (!kobj->name || !kobj->name[0]) {
-		WARN(1, "kobject: (%p): attempted to be registered with empty "
-			 "name!\n", kobj);
+		WARN(1, "kobject: (%p): attempted to be registered with empty name!\n",
+		     kobj);
 		return -EINVAL;
 	}
 
@@ -590,9 +590,8 @@ void kobject_put(struct kobject *kobj)
 {
 	if (kobj) {
 		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(1, "kobject: '%s' (%p): is not initialized, yet kobject_put() is being called\n",
+			     kobject_name(kobj), kobj);
 		kref_put(&kobj->kref, kobject_release);
 	}
 }
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 70af0a7..78f0a74 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -345,7 +345,7 @@ int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
 	int len;
 
 	if (env->envp_idx >= ARRAY_SIZE(env->envp)) {
-		WARN(1, KERN_ERR "add_uevent_var: too many keys\n");
+		WARN(1, "%s(): too many keys\n", __func__);
 		return -ENOMEM;
 	}
 
@@ -356,7 +356,7 @@ int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
 	va_end(args);
 
 	if (len >= (sizeof(env->buf) - env->buflen)) {
-		WARN(1, KERN_ERR "add_uevent_var: buffer size too small\n");
+		WARN(1, "%s(): buffer size too small\n", __func__);
 		return -ENOMEM;
 	}
 
diff --git a/lib/list_debug.c b/lib/list_debug.c
index 344c710..b574054 100644
--- a/lib/list_debug.c
+++ b/lib/list_debug.c
@@ -21,13 +21,11 @@ void __list_add(struct list_head *new,
 			      struct list_head *next)
 {
 	WARN(next->prev != prev,
-		"list_add corruption. next->prev should be "
-		"prev (%p), but was %p. (next=%p).\n",
-		prev, next->prev, next);
+	     "list_add corruption. next->prev should be prev (%p), but was %p. (next=%p)\n",
+	     prev, next->prev, next);
 	WARN(prev->next != next,
-		"list_add corruption. prev->next should be "
-		"next (%p), but was %p. (prev=%p).\n",
-		next, prev->next, prev);
+	     "list_add corruption. prev->next should be next (%p), but was %p. (prev=%p)\n",
+	     next, prev->next, prev);
 	next->prev = new;
 	new->next = next;
 	new->prev = prev;
@@ -44,17 +42,15 @@ EXPORT_SYMBOL(__list_add);
 void list_del(struct list_head *entry)
 {
 	WARN(entry->next == LIST_POISON1,
-		"list_del corruption, next is LIST_POISON1 (%p)\n",
-		LIST_POISON1);
+	     "list_del corruption, next is LIST_POISON1 (%p)\n", LIST_POISON1);
 	WARN(entry->next != LIST_POISON1 && entry->prev == LIST_POISON2,
-		"list_del corruption, prev is LIST_POISON2 (%p)\n",
-		LIST_POISON2);
+	     "list_del corruption, prev is LIST_POISON2 (%p)\n", LIST_POISON2);
 	WARN(entry->prev->next != entry,
-		"list_del corruption. prev->next should be %p, "
-		"but was %p\n", entry, entry->prev->next);
+	     "list_del corruption. prev->next should be %p, but was %p\n",
+	     entry, entry->prev->next);
 	WARN(entry->next->prev != entry,
-		"list_del corruption. next->prev should be %p, "
-		"but was %p\n", entry, entry->next->prev);
+	     "list_del corruption. next->prev should be %p, but was %p\n",
+	     entry, entry->next->prev);
 	__list_del(entry->prev, entry->next);
 	entry->next = LIST_POISON1;
 	entry->prev = LIST_POISON2;
diff --git a/lib/plist.c b/lib/plist.c
index 1471988..8923f3a 100644
--- a/lib/plist.c
+++ b/lib/plist.c
@@ -32,12 +32,12 @@ static void plist_check_prev_next(struct list_head *t, struct list_head *p,
 				  struct list_head *n)
 {
 	WARN(n->prev != p || p->next != n,
-			"top: %p, n: %p, p: %p\n"
-			"prev: %p, n: %p, p: %p\n"
-			"next: %p, n: %p, p: %p\n",
-			 t, t->next, t->prev,
-			p, p->next, p->prev,
-			n, n->next, n->prev);
+	     "top: %p, n: %p, p: %p\n"
+	     "prev: %p, n: %p, p: %p\n"
+	     "next: %p, n: %p, p: %p\n",
+	     t, t->next, t->prev,
+	     p, p->next, p->prev,
+	     n, n->next, n->prev);
 }
 
 static void plist_check_list(struct list_head *top)
-- 
1.7.3.1.g432b3.dirty


  parent reply	other threads:[~2010-10-30 21:11 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-30 21:08 [PATCH 00/39] Cleanup WARN #defines Joe Perches
2010-10-30 21:08 ` Joe Perches
2010-10-30 21:08 ` Joe Perches
2010-10-30 21:08 ` Joe Perches
2010-10-30 21:08 ` Joe Perches
2010-10-30 21:08 ` [PATCH 01/39] include/asm-generic/bug.h: Update WARN macros Joe Perches
2010-10-30 21:08 ` [PATCH 02/39] arch/alpha: Update WARN uses Joe Perches
2010-10-30 21:17   ` Matt Turner
2010-10-30 21:28     ` Joe Perches
2010-10-31  1:11       ` Michael Cree
2010-10-31  1:38         ` Joe Perches
2010-10-30 21:08 ` [PATCH 03/39] arch/arm: " Joe Perches
2010-10-30 21:08   ` Joe Perches
2010-10-30 21:08   ` Joe Perches
2010-10-30 21:08 ` [PATCH 04/39] arch/powerpc: " Joe Perches
2010-10-30 21:08   ` Joe Perches
2010-11-01 11:02   ` Michael Ellerman
2010-11-01 11:02     ` Michael Ellerman
2010-11-01 14:41     ` Joe Perches
2010-11-01 14:41       ` Joe Perches
2010-11-02  0:26       ` Michael Ellerman
2010-11-02  0:26         ` Michael Ellerman
2010-11-02  1:50         ` Joe Perches
2010-11-02  1:50           ` Joe Perches
2010-11-02  3:20           ` Michael Ellerman
2010-11-02  3:20             ` Michael Ellerman
2010-10-30 21:08 ` [PATCH 05/39] arch/x86: " Joe Perches
2010-10-30 21:08   ` Joe Perches
2010-10-31  1:38   ` Rafael J. Wysocki
2010-10-31  1:38   ` Rafael J. Wysocki
2010-10-30 21:08 ` [PATCH 06/39] drivers/acpi: " Joe Perches
2010-10-30 21:08 ` [PATCH 07/39] drivers/base: " Joe Perches
2010-10-30 21:08 ` [PATCH 08/39] drivers/block: " Joe Perches
2010-10-30 21:08 ` [PATCH 09/39] drivers/cpuidle: " Joe Perches
2010-10-30 21:08 ` [PATCH 10/39] drivers/firewire: " Joe Perches
2010-10-30 21:57   ` Stefan Richter
2010-10-30 21:08 ` [PATCH 11/39] drivers/firmware: " Joe Perches
2010-10-30 21:08 ` [PATCH 12/39] drivers/gpio: " Joe Perches
2010-10-30 21:08 ` [PATCH 13/39] drivers/gpu/drm: " Joe Perches
2010-10-30 21:08   ` Joe Perches
2010-10-30 21:08 ` [PATCH 14/39] drivers/media/video: " Joe Perches
2010-10-30 21:08   ` Joe Perches
2010-10-30 21:08 ` [PATCH 15/39] drivers/mfd: " Joe Perches
2010-11-26 10:02   ` Samuel Ortiz
2010-10-30 21:08 ` [PATCH 16/39] drivers/net/can: " Joe Perches
2010-11-09 17:23   ` David Miller
2010-11-09 17:23     ` David Miller
2010-10-30 21:08 ` [PATCH 17/39] drivers/net/usb: " Joe Perches
2010-11-09 17:23   ` David Miller
2010-10-30 21:08 ` [PATCH 18/39] drivers/net/wireless/iwlwifi: " Joe Perches
2010-10-30 21:08 ` [PATCH 19/39] drivers/regulator: " Joe Perches
2010-11-01 13:25   ` Mark Brown
2010-10-30 21:08 ` [PATCH 20/39] drivers/scsi/fcoe: " Joe Perches
2010-10-30 21:08 ` [PATCH 21/39] drivers/staging: " Joe Perches
2010-11-09 23:50   ` Greg KH
2010-10-30 21:08 ` [PATCH 22/39] drivers/usb/musb: " Joe Perches
2010-11-05 11:44   ` Felipe Balbi
2010-11-05 13:54     ` Jiri Kosina
2010-11-05 13:56       ` Felipe Balbi
2010-10-30 21:08 ` [PATCH 23/39] drivers/video/omap2/dss: " Joe Perches
2010-10-30 21:08   ` Joe Perches
2010-10-30 21:08 ` [PATCH 24/39] fs/nfsd: " Joe Perches
2010-10-30 21:08 ` [PATCH 25/39] fs/notify/inotify: " Joe Perches
2010-10-30 21:08 ` [PATCH 26/39] fs/sysfs: " Joe Perches
2010-10-30 21:08 ` [PATCH 27/39] fs/proc: " Joe Perches
2010-10-30 21:08 ` [PATCH 28/39] fs: " Joe Perches
2010-10-30 21:08 ` [PATCH 29/39] include/linux/device.h: " Joe Perches
2010-10-30 21:08 ` [PATCH 30/39] kernel/irq: " Joe Perches
2010-10-30 21:08 ` [PATCH 31/39] kernel/panic.c: Update warn_slowpath to use %pV Joe Perches
2010-10-30 21:08 ` [PATCH 32/39] kernel: Update WARN uses Joe Perches
2010-10-30 21:08 ` Joe Perches [this message]
2010-10-30 21:08 ` [PATCH 34/39] mm: " Joe Perches
2010-10-30 21:08   ` Joe Perches
2010-11-08 12:03   ` Michał Nazarewicz
2010-11-08 12:03     ` Michał Nazarewicz
2010-10-30 21:08 ` [PATCH 35/39] net/core/dev.c: " Joe Perches
2010-11-09 17:23   ` David Miller
2010-10-30 21:08 ` [PATCH 36/39] net/ipv4/tcp.c: " Joe Perches
2010-11-09 17:23   ` David Miller
2010-10-30 21:08 ` [PATCH 37/39] net/mac80211: " Joe Perches
2010-10-30 21:08   ` Joe Perches
2010-10-31  7:33   ` Johannes Berg
2010-10-30 21:08 ` [PATCH 38/39] net/rfkill/input.c: " Joe Perches
2010-10-30 21:08 ` [PATCH 39/39] sound/soc/codecs/wm_hubs.c: " Joe Perches
2010-11-01 19:47   ` Mark Brown
2010-11-01 19:47     ` Mark Brown

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=4c14c8dfad71a552d1d927aec07fac0d40ba81e4.1288471898.git.joe@perches.com \
    --to=joe@perches.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trivial@kernel.org \
    /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.