From d3e7ec5a561ac6418cd9add6f8f7d837f2914d0d Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sun, 16 Jan 2022 00:04:24 +0200 Subject: [PATCH] Kernel: Remove useless return value from procfs_get_thread_stack --- Kernel/Process.h | 2 +- Kernel/ProcessSpecificExposed.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Kernel/Process.h b/Kernel/Process.h index a18398824cd..6fdf0e7ec37 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -567,7 +567,7 @@ public: ErrorOr procfs_get_binary_link(KBufferBuilder& builder) const; ErrorOr procfs_get_current_work_directory_link(KBufferBuilder& builder) const; mode_t binary_link_required_mode() const; - ErrorOr procfs_get_thread_stack(ThreadID thread_id, KBufferBuilder& builder) const; + ErrorOr procfs_get_thread_stack(ThreadID thread_id, KBufferBuilder& builder) const; ErrorOr traverse_stacks_directory(FileSystemID, Function(FileSystem::DirectoryEntryView const&)> callback) const; ErrorOr> lookup_stacks_directory(const ProcFS&, StringView name) const; ErrorOr procfs_get_file_description_link(unsigned fd, KBufferBuilder& builder) const; diff --git a/Kernel/ProcessSpecificExposed.cpp b/Kernel/ProcessSpecificExposed.cpp index 85d11cbd231..70bfd36273d 100644 --- a/Kernel/ProcessSpecificExposed.cpp +++ b/Kernel/ProcessSpecificExposed.cpp @@ -19,12 +19,12 @@ namespace Kernel { -ErrorOr Process::procfs_get_thread_stack(ThreadID thread_id, KBufferBuilder& builder) const +ErrorOr Process::procfs_get_thread_stack(ThreadID thread_id, KBufferBuilder& builder) const { JsonArraySerializer array { builder }; auto thread = Thread::from_tid(thread_id); if (!thread) - return Error::from_errno(ESRCH); + return ESRCH; bool show_kernel_addresses = Process::current().is_superuser(); bool kernel_address_added = false; for (auto address : Processor::capture_stack_trace(*thread, 1024)) { @@ -38,8 +38,7 @@ ErrorOr Process::procfs_get_thread_stack(ThreadID thread_id, KBufferBuil } array.finish(); - // FIXME: This return value seems useless. - return 0; + return {}; } ErrorOr Process::traverse_stacks_directory(FileSystemID fsid, Function(FileSystem::DirectoryEntryView const&)> callback) const