Skip to content

Commit

Permalink
bug: define the "cut here" string in a single place
Browse files Browse the repository at this point in the history
The "cut here" string is used in a few paths.  Define it in a single
place.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Kees Cook <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Fengguang Wu <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
kees authored and torvalds committed Nov 18, 2017
1 parent d32f11b commit 2a8358d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arch/mn10300/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 2 additions & 0 deletions include/asm-generic/bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion kernel/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion lib/bug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2a8358d

Please sign in to comment.