diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2023-07-07 21:40:52 +0100 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2023-07-15 08:02:32 +0100 |
commit | bef6f008b9811d961fd311c102f1a22dc28278a1 (patch) | |
tree | 4ad2dbec9cb5b560a8dfaf400f0bbf191aca7344 /linux-user | |
parent | 91e9e116fea2a3b957e86daf55c832155fdf4b04 (diff) | |
download | qemu-bef6f008b9811d961fd311c102f1a22dc28278a1.zip qemu-bef6f008b9811d961fd311c102f1a22dc28278a1.tar.gz qemu-bef6f008b9811d961fd311c102f1a22dc28278a1.tar.bz2 |
accel/tcg: Return bool from page_check_range
Replace the 0/-1 result with true/false.
Invert the sense of the test of all callers.
Document the function.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230707204054.8792-25-richard.henderson@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/qemu.h | 2 | ||||
-rw-r--r-- | linux-user/syscall.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 9b8e086..802794d 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -182,7 +182,7 @@ static inline bool access_ok_untagged(int type, abi_ulong addr, abi_ulong size) : !guest_range_valid_untagged(addr, size)) { return false; } - return page_check_range((target_ulong)addr, size, type) == 0; + return page_check_range((target_ulong)addr, size, type); } static inline bool access_ok(CPUState *cpu, int type, diff --git a/linux-user/syscall.c b/linux-user/syscall.c index a80d33e..33bc242 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8122,7 +8122,7 @@ static int open_self_maps_1(CPUArchState *cpu_env, int fd, bool smaps) max = h2g_valid(max - 1) ? max : (uintptr_t) g2h_untagged(GUEST_ADDR_MAX) + 1; - if (page_check_range(h2g(min), max - min, flags) == -1) { + if (!page_check_range(h2g(min), max - min, flags)) { continue; } |