소스 검색

bug: define the "cut here" string in a single place

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>
Kees Cook 7 년 전
부모
커밋
2a8358d8a3
4개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      arch/mn10300/mm/fault.c
  2. 2 0
      include/asm-generic/bug.h
  3. 1 1
      kernel/panic.c
  4. 1 1
      lib/bug.c

+ 1 - 1
arch/mn10300/mm/fault.c

@@ -60,7 +60,7 @@ void bust_spinlocks(int yes)
 void do_BUG(const char *file, int line)
 void do_BUG(const char *file, int line)
 {
 {
 	bust_spinlocks(1);
 	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);
 	printk(KERN_EMERG "kernel BUG at %s:%d!\n", file, line);
 }
 }
 
 

+ 2 - 0
include/asm-generic/bug.h

@@ -4,6 +4,8 @@
 
 
 #include <linux/compiler.h>
 #include <linux/compiler.h>
 
 
+#define CUT_HERE		"------------[ cut here ]------------\n"
+
 #ifdef CONFIG_GENERIC_BUG
 #ifdef CONFIG_GENERIC_BUG
 #define BUGFLAG_WARNING		(1 << 0)
 #define BUGFLAG_WARNING		(1 << 0)
 #define BUGFLAG_ONCE		(1 << 1)
 #define BUGFLAG_ONCE		(1 << 1)

+ 1 - 1
kernel/panic.c

@@ -520,7 +520,7 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
 {
 {
 	disable_trace_on_warning();
 	disable_trace_on_warning();
 
 
-	pr_warn("------------[ cut here ]------------\n");
+	pr_warn(CUT_HERE);
 
 
 	if (file)
 	if (file)
 		pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n",
 		pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n",

+ 1 - 1
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;
 		return BUG_TRAP_TYPE_WARN;
 	}
 	}
 
 
-	printk(KERN_DEFAULT "------------[ cut here ]------------\n");
+	printk(KERN_DEFAULT CUT_HERE);
 
 
 	if (file)
 	if (file)
 		pr_crit("kernel BUG at %s:%u!\n", file, line);
 		pr_crit("kernel BUG at %s:%u!\n", file, line);