diff options
author | Andreas Kling <kling@serenityos.org> | 2020-08-13 20:16:50 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-13 20:18:11 +0200 |
commit | 6d9b59f1b7b958e890e4b6e68ed333a910e40920 (patch) | |
tree | 3a549787294c23f6e1b767ab3068e6bb758a990f /Kernel | |
parent | b777640fef90d1170fd5bd3ea43fe7a4df2f19d1 (diff) | |
download | serenity-6d9b59f1b7b958e890e4b6e68ed333a910e40920.zip |
Kernel: Simplify the way we check for "serial_debug" on command line
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/init.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/Kernel/init.cpp b/Kernel/init.cpp index 2e2c790e23..608b8715a1 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -362,24 +362,13 @@ void init_stage2() void setup_serial_debug() { - // this is only used one time, directly below here. we can't use this part - // of libc at this point in the boot process, or we'd just pull strstr in - // from <string.h>. - auto bad_prefix_check = [](const char* str, const char* search) -> bool { - while (*search) - if (*search++ != *str++) - return false; - - return true; - }; - // serial_debug will output all the klog() and dbg() data to COM1 at // 8-N-1 57600 baud. this is particularly useful for debugging the boot // process on live hardware. // // note: it must be the first option in the boot cmdline. u32 cmdline = low_physical_to_virtual(multiboot_info_ptr->cmdline); - if (cmdline && bad_prefix_check(reinterpret_cast<const char*>(cmdline), "serial_debug")) + if (cmdline && StringView(reinterpret_cast<const char*>(cmdline)).starts_with("serial_debug")) set_serial_debug(true); } |