From a3228d9b7770d02504e9e468266f3326a49862b7 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 30 Dec 2017 13:40:28 -0500 Subject: [PATCH] svc: Minor cleanups. --- src/core/hle/svc.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 120cf75f3..9f983ce0e 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -73,7 +73,7 @@ static ResultCode ConnectToPort(Kernel::Handle* out_handle, VAddr port_name_addr /// Makes a blocking IPC call to an OS service. static ResultCode SendSyncRequest(Kernel::Handle handle) { SharedPtr session = Kernel::g_handle_table.Get(handle); - if (session == nullptr) { + if (!session) { LOG_ERROR(Kernel_SVC, "called with invalid handle=0x%08X", handle); return ERR_INVALID_HANDLE; } @@ -88,11 +88,11 @@ static ResultCode SendSyncRequest(Kernel::Handle handle) { } /// Get the ID for the specified thread. -static ResultCode GetThreadId(u32* thread_id, Kernel::Handle handle) { - LOG_TRACE(Kernel_SVC, "called thread=0x%08X", handle); +static ResultCode GetThreadId(u32* thread_id, Kernel::Handle thread_handle) { + LOG_TRACE(Kernel_SVC, "called thread=0x%08X", thread_handle); - const SharedPtr thread = Kernel::g_handle_table.Get(handle); - if (thread == nullptr) { + const SharedPtr thread = Kernel::g_handle_table.Get(thread_handle); + if (!thread) { return ERR_INVALID_HANDLE; } @@ -106,7 +106,7 @@ static ResultCode GetProcessId(u32* process_id, Kernel::Handle process_handle) { const SharedPtr process = Kernel::g_handle_table.Get(process_handle); - if (process == nullptr) { + if (!process) { return ERR_INVALID_HANDLE; } @@ -153,7 +153,7 @@ static ResultCode QueryProcessMemory(MemoryInfo* memory_info, PageInfo* /*page_i Kernel::Handle process_handle, u64 addr) { using Kernel::Process; Kernel::SharedPtr process = Kernel::g_handle_table.Get(process_handle); - if (process == nullptr) { + if (!process) { return ERR_INVALID_HANDLE; } auto vma = process->vm_manager.FindVMA(addr); @@ -169,6 +169,7 @@ static ResultCode QueryProcessMemory(MemoryInfo* memory_info, PageInfo* /*page_i memory_info->size = vma->second.size; memory_info->type = static_cast(vma->second.meminfo_state); } + LOG_TRACE(Kernel_SVC, "called process=0x%08X addr=%llx", process_handle, addr); return RESULT_SUCCESS; } @@ -179,7 +180,7 @@ static ResultCode QueryMemory(MemoryInfo* memory_info, PageInfo* page_info, VAdd return QueryProcessMemory(memory_info, page_info, Kernel::CurrentProcess, addr); } -/// Starts the thread for the provided handle. +/// Starts the thread for the provided handle static ResultCode StartThread(Handle thread_handle) { LOG_TRACE(Kernel_SVC, "called thread=0x%08X", thread_handle);