Skip to content

Commit

Permalink
xen/riscv: fix type mismatch in read_atomic_size()
Browse files Browse the repository at this point in the history
Correct a typo in read_atomic_size() where a 64-bit result
was incorrectly cast to a `uint32_t` instead of `uint64_t`
in the case of 8-byte reads.

Fixes: 3cd46d4 ("xen/riscv: introduce atomic.h")
Reported-by: Andrew Cooper <[email protected]>
Signed-off-by: Oleksii Kurochko <[email protected]>
Reviewed-by: Jan Beulich <[email protected]>
  • Loading branch information
Oleksii Kurochko authored and jbeulich committed Sep 9, 2024
1 parent 71df923 commit 4e56d0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xen/arch/riscv/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static always_inline void read_atomic_size(const volatile void *p,
case 2: *(uint16_t *)res = readw(p); break;
case 4: *(uint32_t *)res = readl(p); break;
#ifndef CONFIG_RISCV_32
case 8: *(uint32_t *)res = readq(p); break;
case 8: *(uint64_t *)res = readq(p); break;
#endif
default: __bad_atomic_size(); break;
}
Expand Down

0 comments on commit 4e56d0a

Please sign in to comment.