diff options
author | Hendiadyoin1 <leon2002.la@gmail.com> | 2021-12-15 15:01:34 +0100 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2021-12-15 23:34:11 -0800 |
commit | 47a39e425c9c8f2624d0cf8cd8d3f7155071d27b (patch) | |
tree | df65ae321469a0277bd1013f09b1538821d717ab /Kernel | |
parent | 4cec16a7136b8c3a6813a13b8fe96b2216da7b11 (diff) | |
download | serenity-47a39e425c9c8f2624d0cf8cd8d3f7155071d27b.zip |
Kernel: Remove else statements after return in Plan9FileSystem.cpp
As per clang-tidy.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/FileSystem/Plan9FileSystem.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/Kernel/FileSystem/Plan9FileSystem.cpp b/Kernel/FileSystem/Plan9FileSystem.cpp index fdf0110d4a..efe6ac0dc5 100644 --- a/Kernel/FileSystem/Plan9FileSystem.cpp +++ b/Kernel/FileSystem/Plan9FileSystem.cpp @@ -603,7 +603,8 @@ ErrorOr<void> Plan9FS::post_message_and_wait_for_a_reply(Message& message) u32 error_code; message >> error_code; return Error::from_errno((ErrnoCode)error_code); - } else if (reply_type == Message::Type::Rerror) { + } + if (reply_type == Message::Type::Rerror) { // Contains an error message. We could attempt to parse it, but for now // we simply return EIO instead. In 9P200.u, it can also contain a // numerical errno in an unspecified encoding; we ignore those too. @@ -611,14 +612,15 @@ ErrorOr<void> Plan9FS::post_message_and_wait_for_a_reply(Message& message) message >> error_name; dbgln("Plan9FS: Received error name {}", error_name); return EIO; - } else if ((u8)reply_type != (u8)request_type + 1) { + } + if ((u8)reply_type != (u8)request_type + 1) { // Other than those error messages. we only expect the matching reply // message type. dbgln("Plan9FS: Received unexpected message type {} in response to {}", (u8)reply_type, (u8)request_type); return EIO; - } else { - return {}; } + + return {}; } size_t Plan9FS::adjust_buffer_size(size_t size) const @@ -711,11 +713,11 @@ ErrorOr<void> Plan9FSInode::ensure_open_for_mode(int mode) Plan9FS::Message message { fs(), Plan9FS::Message::Type::Tlopen }; message << fid() << l_mode; return fs().post_message_and_wait_for_a_reply(message); - } else { - Plan9FS::Message message { fs(), Plan9FS::Message::Type::Topen }; - message << fid() << p9_mode; - return fs().post_message_and_wait_for_a_reply(message); } + + Plan9FS::Message message { fs(), Plan9FS::Message::Type::Topen }; + message << fid() << p9_mode; + return fs().post_message_and_wait_for_a_reply(message); } ErrorOr<size_t> Plan9FSInode::read_bytes(off_t offset, size_t size, UserOrKernelBuffer& buffer, OpenFileDescription*) const @@ -887,10 +889,10 @@ ErrorOr<void> Plan9FSInode::traverse_as_directory(Function<ErrorOr<void>(FileSys // FIXME: Should we observe this error? [[maybe_unused]] auto rc = fs().post_message_and_explicitly_ignore_reply(close_message); return result; - } else { - // TODO - return ENOTIMPL; } + + // TODO + return ENOTIMPL; } ErrorOr<NonnullRefPtr<Inode>> Plan9FSInode::lookup(StringView name) @@ -946,10 +948,10 @@ ErrorOr<void> Plan9FSInode::truncate(u64 new_size) u64 mtime_nsec = 0; message << fid() << (u64)valid << mode << uid << gid << new_size << atime_sec << atime_nsec << mtime_sec << mtime_nsec; return fs().post_message_and_wait_for_a_reply(message); - } else { - // TODO: wstat version - return {}; } + + // TODO: wstat version + return {}; } } |