aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-memcpy.c
diff options
context:
space:
mode:
authorUros Bizjak <[email protected]>2023-07-03 17:00:59 +0200
committerAlex Deucher <[email protected]>2023-08-09 18:08:51 -0400
commit9e761bff03e137fca0c41fd3bcc3e88167d59dc1 (patch)
tree3022d4c81133a842ca8ef7838240a0ff3d4d61bb /lib/test_fortify/write_overflow-memcpy.c
parent59070fd9ccea58c3363d39f69c25fa98c71eb02f (diff)
drm/amdgpu: Use local64_try_cmpxchg in amdgpu_perf_read
Use local64_try_cmpxchg instead of local64_cmpxchg (*ptr, old, new) == old in amdgpu_perf_read. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Also, try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails. There is no need to re-read the value in the loop. No functional change intended. Cc: Alex Deucher <[email protected]> Cc: "Christian König" <[email protected]> Cc: "Pan, Xinhui" <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Signed-off-by: Uros Bizjak <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-memcpy.c')
0 files changed, 0 insertions, 0 deletions