linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/traps: add CONFIG_BUG to the use of __warn()
@ 2022-04-25  5:59 Stephen Zhang
  2022-04-25 16:05 ` Dave Hansen
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Zhang @ 2022-04-25  5:59 UTC (permalink / raw)
  To: tglx, mingo, bp, dave.hansen, x86
  Cc: hpa, peterz, laijs, lihuafei1, fenghua.yu, chang.seok.bae,
	zhangshida, linux-kernel

From: zhangshida <zhangshida@kylinos.cn>

__warn() is declared when CONFIG_BUG is defined, so add
CONFIG_BUG when used.

Signed-off-by: zhangshida <zhangshida@kylinos.cn>
---
 arch/x86/kernel/traps.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 1563fb995005..81cc28a59c24 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -246,7 +246,9 @@ DEFINE_IDTENTRY_ERRORCODE(exc_control_protection)
 	pr_err("Missing ENDBR: %pS\n", (void *)instruction_pointer(regs));
 	if (!ibt_fatal) {
 		printk(KERN_DEFAULT CUT_HERE);
+#ifdef CONFIG_BUG
 		__warn(__FILE__, __LINE__, (void *)regs->ip, TAINT_WARN, regs, NULL);
+#endif
 		return;
 	}
 	BUG();
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-26  1:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25  5:59 [PATCH] x86/traps: add CONFIG_BUG to the use of __warn() Stephen Zhang
2022-04-25 16:05 ` Dave Hansen
2022-04-25 18:24   ` Peter Zijlstra
2022-04-25 19:28     ` Peter Zijlstra
2022-04-26  1:23       ` Stephen Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).