mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:48:12 +00:00
Kernel: Fix -Wunreachable-code warnings from clang
This commit is contained in:
parent
e84c03ad61
commit
1cdb12e920
7 changed files with 6 additions and 12 deletions
|
@ -46,7 +46,7 @@ UNMAP_AFTER_INIT void CommandLine::build_commandline(const String& cmdline_from_
|
||||||
{
|
{
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
builder.append(cmdline_from_bootloader);
|
builder.append(cmdline_from_bootloader);
|
||||||
if (!s_embedded_cmd_line.is_empty()) {
|
if constexpr (!s_embedded_cmd_line.is_empty()) {
|
||||||
builder.append(" ");
|
builder.append(" ");
|
||||||
builder.append(s_embedded_cmd_line);
|
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)
|
} while (0)
|
||||||
|
|
||||||
SmapDisabler disabler;
|
SmapDisabler disabler;
|
||||||
if (use_ksyms && !g_kernel_symbols_available) {
|
if (use_ksyms && !g_kernel_symbols_available)
|
||||||
Processor::halt();
|
Processor::halt();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct RecognizedSymbol {
|
struct RecognizedSymbol {
|
||||||
FlatPtr address;
|
FlatPtr address;
|
||||||
|
|
|
@ -413,7 +413,7 @@ KResult LocalSocket::getsockopt(OpenFileDescription& description, int level, int
|
||||||
default:
|
default:
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
break;
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return Socket::getsockopt(description, level, option, value, value_size);
|
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);
|
socket->set_state(TCPSocket::State::Closed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
VERIFY_NOT_REACHED();
|
||||||
|
|
||||||
return;
|
|
||||||
case TCPFlags::SYN:
|
case TCPFlags::SYN:
|
||||||
dbgln("handle_tcp: ignoring SYN for partially established connection");
|
dbgln("handle_tcp: ignoring SYN for partially established connection");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -592,8 +592,8 @@ bool Process::dump_perfcore()
|
||||||
}
|
}
|
||||||
auto json_buffer = UserOrKernelBuffer::for_kernel_buffer(json->data());
|
auto json_buffer = UserOrKernelBuffer::for_kernel_buffer(json->data());
|
||||||
if (description.write(json_buffer, json->size()).is_error()) {
|
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());
|
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());
|
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) {
|
switch (function) {
|
||||||
case SC_exit:
|
case SC_exit:
|
||||||
process.sys$exit(arg1);
|
process.sys$exit(arg1);
|
||||||
break;
|
|
||||||
case SC_exit_thread:
|
case SC_exit_thread:
|
||||||
process.sys$exit_thread(arg1, arg2, arg3);
|
process.sys$exit_thread(arg1, arg2, arg3);
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,10 +18,8 @@ KResultOr<FlatPtr> Process::sys$prctl(int option, FlatPtr arg1, [[maybe_unused]]
|
||||||
case PR_SET_DUMPABLE:
|
case PR_SET_DUMPABLE:
|
||||||
set_dumpable(arg1);
|
set_dumpable(arg1);
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
|
||||||
return EINVAL;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue