mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 10:36:24 +00:00
Kernel: Fix -Wunreachable-code warnings from clang
This commit is contained in:
parent
e84c03ad61
commit
1cdb12e920
|
@ -46,7 +46,7 @@ UNMAP_AFTER_INIT void CommandLine::build_commandline(const String& cmdline_from_
|
|||
{
|
||||
StringBuilder builder;
|
||||
builder.append(cmdline_from_bootloader);
|
||||
if (!s_embedded_cmd_line.is_empty()) {
|
||||
if constexpr (!s_embedded_cmd_line.is_empty()) {
|
||||
builder.append(" ");
|
||||
builder.append(s_embedded_cmd_line);
|
||||
}
|
||||
|
|
|
@ -111,10 +111,8 @@ NEVER_INLINE static void dump_backtrace_impl(FlatPtr base_pointer, bool use_ksym
|
|||
} while (0)
|
||||
|
||||
SmapDisabler disabler;
|
||||
if (use_ksyms && !g_kernel_symbols_available) {
|
||||
if (use_ksyms && !g_kernel_symbols_available)
|
||||
Processor::halt();
|
||||
return;
|
||||
}
|
||||
|
||||
struct RecognizedSymbol {
|
||||
FlatPtr address;
|
||||
|
|
|
@ -413,7 +413,7 @@ KResult LocalSocket::getsockopt(OpenFileDescription& description, int level, int
|
|||
default:
|
||||
return EINVAL;
|
||||
}
|
||||
break;
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
default:
|
||||
return Socket::getsockopt(description, level, option, value, value_size);
|
||||
|
|
|
@ -531,8 +531,8 @@ void handle_tcp(IPv4Packet const& ipv4_packet, Time const& packet_timestamp)
|
|||
socket->set_state(TCPSocket::State::Closed);
|
||||
return;
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
return;
|
||||
case TCPFlags::SYN:
|
||||
dbgln("handle_tcp: ignoring SYN for partially established connection");
|
||||
return;
|
||||
|
|
|
@ -592,8 +592,8 @@ bool Process::dump_perfcore()
|
|||
}
|
||||
auto json_buffer = UserOrKernelBuffer::for_kernel_buffer(json->data());
|
||||
if (description.write(json_buffer, json->size()).is_error()) {
|
||||
return false;
|
||||
dbgln("Failed to generate perfcore for pid {}: Could not write to perfcore file.", pid().value());
|
||||
return false;
|
||||
}
|
||||
|
||||
dbgln("Wrote perfcore for pid {} to {}", pid().value(), description.absolute_path());
|
||||
|
|
|
@ -141,10 +141,8 @@ KResultOr<FlatPtr> handle(RegisterState& regs, FlatPtr function, FlatPtr arg1, F
|
|||
switch (function) {
|
||||
case SC_exit:
|
||||
process.sys$exit(arg1);
|
||||
break;
|
||||
case SC_exit_thread:
|
||||
process.sys$exit_thread(arg1, arg2, arg3);
|
||||
break;
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
|
|
@ -18,10 +18,8 @@ KResultOr<FlatPtr> Process::sys$prctl(int option, FlatPtr arg1, [[maybe_unused]]
|
|||
case PR_SET_DUMPABLE:
|
||||
set_dumpable(arg1);
|
||||
return 0;
|
||||
default:
|
||||
return EINVAL;
|
||||
}
|
||||
return 0;
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue