]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: Use atomic_try_cmpxchg in ep_state_update
authorUros Bizjak <ubizjak@gmail.com>
Wed, 13 Jul 2022 15:19:46 +0000 (17:19 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 14 Jul 2022 08:49:25 +0000 (10:49 +0200)
commitfe098b97106341a6860594d1443bf8c3b3a64c20
treed2a4f11902e5d2ab4bb8872e6208d88d18adc873
parent6032ba46ff5465bfc139e1b01db7929e0a89608a
ALSA: usb-audio: Use atomic_try_cmpxchg in ep_state_update

Use atomic_try_cmpxchg instead of atomic_cmpxchg (*ptr, old, new) == old in
ep_state_update. x86 CMPXCHG instruction returns success in ZF flag,
so this change saves a compare after cmpxchg (and related move instruction
in front of cmpxchg).

No functional change intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Link: https://lore.kernel.org/r/20220713151946.4743-1-ubizjak@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/endpoint.c