From 69acd1f2cfdbf7ded636a8ec098a1dcc86fecdb0 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 29 Feb 2024 22:09:17 -0500 Subject: kernel/amd64: trap: Simplify trap_print() logic Signed-off-by: Ian Moffett --- sys/arch/amd64/amd64/trap.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'sys/arch/amd64') diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c index 703b6cf..cbcf730 100644 --- a/sys/arch/amd64/amd64/trap.c +++ b/sys/arch/amd64/amd64/trap.c @@ -52,15 +52,11 @@ static const int TRAP_COUNT = __ARRAY_COUNT(trap_type); static void trap_print(struct trapframe *tf) { - const char *mode; - if (tf->trapno < TRAP_COUNT) { - kprintf("** Fatal %s", trap_type[tf->trapno]); + kprintf("** Fatal %s **\n", trap_type[tf->trapno]); } else { - kprintf("** Unknown trap %d", tf->trapno); + kprintf("** Unknown trap %d **\n", tf->trapno); } - mode = __TEST(tf->trapno, TRAP_USER) ? "user" : "supervisor"; - kprintf(" in %s mode **\n", mode); } static void -- cgit v1.2.3