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

Arjan van de Ven
2008-07-08T16:57:21Z

From: Arjan van de Ven <arjan@linux.intel.com>
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@linux.intel.com>
---
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;
}
/*