From 47a39e425c9c8f2624d0cf8cd8d3f7155071d27b Mon Sep 17 00:00:00 2001 From: Hendiadyoin1 Date: Wed, 15 Dec 2021 15:01:34 +0100 Subject: Kernel: Remove else statements after return in Plan9FileSystem.cpp As per clang-tidy. --- Kernel/FileSystem/Plan9FileSystem.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'Kernel') 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 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 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 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 Plan9FSInode::read_bytes(off_t offset, size_t size, UserOrKernelBuffer& buffer, OpenFileDescription*) const @@ -887,10 +889,10 @@ ErrorOr Plan9FSInode::traverse_as_directory(Function(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> Plan9FSInode::lookup(StringView name) @@ -946,10 +948,10 @@ ErrorOr 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 {}; } } -- cgit v1.2.3