summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2021-02-03 21:56:20 -0500
committerLioncash <mathew1800@gmail.com>2021-02-06 04:08:27 -0500
commit40ab2b934805e80b0a54d390b7b58291c37af36f (patch)
treeb1257724da679a47e482bd2931b36260b846abef /src
parentb8fc74d74d766caaf4f66a1d1064585b2d40ce8e (diff)
k_address_arbiter: Unfold R_UNLESS macros
Allows for more descriptive error messages and also doesn't hide control-path exit returns from the reader.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/k_address_arbiter.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/hle/kernel/k_address_arbiter.cpp b/src/core/hle/kernel/k_address_arbiter.cpp
index 3c3e51dbe..d0e90fd60 100644
--- a/src/core/hle/kernel/k_address_arbiter.cpp
+++ b/src/core/hle/kernel/k_address_arbiter.cpp
@@ -118,9 +118,10 @@ ResultCode KAddressArbiter::SignalAndIncrementIfEqual(VAddr addr, s32 value, s32
// Check the userspace value.
s32 user_value{};
- R_UNLESS(UpdateIfEqual(system, &user_value, addr, value, value + 1),
- Svc::ResultInvalidCurrentMemory);
-
+ if (!UpdateIfEqual(system, &user_value, addr, value, value + 1)) {
+ LOG_ERROR(Kernel, "Invalid current memory!");
+ return Svc::ResultInvalidCurrentMemory;
+ }
if (user_value != value) {
return Svc::ResultInvalidState;
}
@@ -186,8 +187,10 @@ ResultCode KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32
succeeded = ReadFromUser(system, &user_value, addr);
}
- R_UNLESS(succeeded, Svc::ResultInvalidCurrentMemory);
-
+ if (!succeeded) {
+ LOG_ERROR(Kernel, "Invalid current memory!");
+ return Svc::ResultInvalidCurrentMemory;
+ }
if (user_value != value) {
return Svc::ResultInvalidState;
}