aboutsummaryrefslogtreecommitdiff
path: root/arch/um/os-Linux
diff options
context:
space:
mode:
authorGravatar Uros Bizjak <ubizjak@gmail.com> 2022-07-14 20:28:22 +0200
committerGravatar Jason A. Donenfeld <Jason@zx2c4.com> 2022-07-18 15:04:04 +0200
commitb7a68f67ff4911e8a842d03f6f97fa91a8d483f5 (patch)
tree14f878e40474fd14b5cfb224b794e8e5e1919f3f /arch/um/os-Linux
parenttimekeeping: contribute wall clock to rng on time change (diff)
downloadlinux-b7a68f67ff4911e8a842d03f6f97fa91a8d483f5.tar.gz
linux-b7a68f67ff4911e8a842d03f6f97fa91a8d483f5.tar.bz2
linux-b7a68f67ff4911e8a842d03f6f97fa91a8d483f5.zip
random: use try_cmpxchg in _credit_init_bits
Use `!try_cmpxchg(ptr, &orig, new)` instead of `cmpxchg(ptr, orig, new) != orig` in _credit_init_bits. This has two benefits: - The x86 cmpxchg instruction returns success in the ZF flag, so this change saves a compare after cmpxchg, as well as a related move instruction in front of cmpxchg. - try_cmpxchg implicitly assigns the *ptr value to &orig when cmpxchg fails, enabling further code simplifications. This patch has no functional change. Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'arch/um/os-Linux')
0 files changed, 0 insertions, 0 deletions