aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2016-03-17 17:23:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-17 18:09:34 -0400
commit2553b67a1fbe7bf202e4e8070ab0b00d3d3a06a2 (patch)
treefc3ae8145246c0914b83693988f3d9f1a695d9bb /include/asm-generic
parent4cc7ecb7f2a60e8deb783b8fbf7c1ae467acb920 (diff)
lib/bug.c: use common WARN helper
The traceoff_on_warning option doesn't have any effect on s390, powerpc, arm64, parisc, and sh because there are two different types of WARN implementations: 1) The above mentioned architectures treat WARN() as a special case of a BUG() exception. They handle warnings in report_bug() in lib/bug.c. 2) All other architectures just call warn_slowpath_*() directly. Their warnings are handled in warn_slowpath_common() in kernel/panic.c. Support traceoff_on_warning on all architectures and prevent any future divergence by using a single common function to emit the warning. Also remove the '()' from '%pS()', because the parentheses look funky: [ 45.607629] WARNING: at /root/warn_mod/warn_mod.c:17 .init_dummy+0x20/0x40 [warn_mod]() Reported-by: Chunyu Hu <chuhu@redhat.com> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com> Tested-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/bug.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index fdf6fa078422..f90588abbfd4 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -81,6 +81,12 @@ extern void warn_slowpath_null(const char *file, const int line);
81 do { printk(arg); __WARN_TAINT(taint); } while (0) 81 do { printk(arg); __WARN_TAINT(taint); } while (0)
82#endif 82#endif
83 83
84/* used internally by panic.c */
85struct warn_args;
86
87void __warn(const char *file, int line, void *caller, unsigned taint,
88 struct pt_regs *regs, struct warn_args *args);
89
84#ifndef WARN_ON 90#ifndef WARN_ON
85#define WARN_ON(condition) ({ \ 91#define WARN_ON(condition) ({ \
86 int __ret_warn_on = !!(condition); \ 92 int __ret_warn_on = !!(condition); \