[patch 5/17] Use WARN() in kernel/panic.c

From: Arjan van de Ven
Date: Tue Jul 08 2008 - 12:57:23 EST


From: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>
Subject: Use WARN instead of printk+WARN_ON in kernel/panic.c

Use WARN() instead of a printk+WARN_ON() pair; this way the message
becomes part of the warning section for better reporting/collection.
This allowed the if() to be folded entirely into the WARN()

Signed-off-by: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>
---
kernel/panic.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

Index: linux.trees.git/kernel/panic.c
===================================================================
--- linux.trees.git.orig/kernel/panic.c
+++ linux.trees.git/kernel/panic.c
@@ -392,10 +392,8 @@ static int __stack_chk_test(void)
printk(KERN_INFO "Testing -fstack-protector-all feature\n");
__stack_check_testing = (unsigned long)&__stack_chk_test_func;
__stack_chk_test_func();
- if (__stack_check_testing) {
- printk(KERN_ERR "-fstack-protector-all test failed\n");
- WARN_ON(1);
- }
+ WARN(__stack_check_testing,
+ KERN_ERR "-fstack-protector-all test failed\n");
return 0;
}
/*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/