aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kobject_uevent.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-07-25 22:45:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 15:00:07 -0400
commit5cd2b459d326a424671dcd95f038649f7bf7cb96 (patch)
tree824514753e173bb69d3fde5fab18f8ddf909751d /lib/kobject_uevent.c
parentf810a5cf28a818db96333cd23646f0227ec015b4 (diff)
Use WARN() in lib/
Use WARN() instead of a printk+WARN_ON() pair; this way the message becomes part of the warning section for better reporting/collection. In addition, one of the if() clauses collapes into the WARN() entirely now. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/kobject_uevent.c')
-rw-r--r--lib/kobject_uevent.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 9f8d599459d1..3f914725bda8 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -285,8 +285,7 @@ int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
285 int len; 285 int len;
286 286
287 if (env->envp_idx >= ARRAY_SIZE(env->envp)) { 287 if (env->envp_idx >= ARRAY_SIZE(env->envp)) {
288 printk(KERN_ERR "add_uevent_var: too many keys\n"); 288 WARN(1, KERN_ERR "add_uevent_var: too many keys\n");
289 WARN_ON(1);
290 return -ENOMEM; 289 return -ENOMEM;
291 } 290 }
292 291
@@ -297,8 +296,7 @@ int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
297 va_end(args); 296 va_end(args);
298 297
299 if (len >= (sizeof(env->buf) - env->buflen)) { 298 if (len >= (sizeof(env->buf) - env->buflen)) {
300 printk(KERN_ERR "add_uevent_var: buffer size too small\n"); 299 WARN(1, KERN_ERR "add_uevent_var: buffer size too small\n");
301 WARN_ON(1);
302 return -ENOMEM; 300 return -ENOMEM;
303 } 301 }
304 302