]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
bug: define the "cut here" string in a single place
authorKees Cook <keescook@chromium.org>
Fri, 17 Nov 2017 23:27:21 +0000 (15:27 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Nov 2017 00:10:01 +0000 (16:10 -0800)
The "cut here" string is used in a few paths.  Define it in a single
place.

Link: http://lkml.kernel.org/r/1510100869-73751-3-git-send-email-keescook@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/mn10300/mm/fault.c
include/asm-generic/bug.h
kernel/panic.c
lib/bug.c

index f23781d6bbb3fed5c763249a52afc3858d2a12fe..f0bfa1448744740f2b2e2d7da0e2206271f453a4 100644 (file)
@@ -60,7 +60,7 @@ void bust_spinlocks(int yes)
 void do_BUG(const char *file, int line)
 {
        bust_spinlocks(1);
-       printk(KERN_EMERG "------------[ cut here ]------------\n");
+       printk(KERN_EMERG CUT_HERE);
        printk(KERN_EMERG "kernel BUG at %s:%d!\n", file, line);
 }
 
index 7844b0df88cd63acd87ec27fd4bbcf74187ed9a9..1283473f234e13e69505affb63853de0d6f0c391 100644 (file)
@@ -4,6 +4,8 @@
 
 #include <linux/compiler.h>
 
+#define CUT_HERE               "------------[ cut here ]------------\n"
+
 #ifdef CONFIG_GENERIC_BUG
 #define BUGFLAG_WARNING                (1 << 0)
 #define BUGFLAG_ONCE           (1 << 1)
index 67cebf2a3b67829cbb119a1262fa1e52d1aaa318..89df5fa2f798f14027128acd83564ebb199ca7a0 100644 (file)
@@ -520,7 +520,7 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
 {
        disable_trace_on_warning();
 
-       pr_warn("------------[ cut here ]------------\n");
+       pr_warn(CUT_HERE);
 
        if (file)
                pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n",
index f66be6bf6206296ad6b08a375b4a80ab5ff51837..c1b0fad31b109157427d1ec1e30e7e93e303465d 100644 (file)
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -186,7 +186,7 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
                return BUG_TRAP_TYPE_WARN;
        }
 
-       printk(KERN_DEFAULT "------------[ cut here ]------------\n");
+       printk(KERN_DEFAULT CUT_HERE);
 
        if (file)
                pr_crit("kernel BUG at %s:%u!\n", file, line);