Replace this pattern in iommu.c:
cmpxchg64{,_local}(*ptr, 0, new) != 0
.. with the simpler and faster:
!try_cmpxchg64{,_local}(*ptr, &tmp, new)
The x86 CMPXCHG instruction returns success in the ZF flag, so this change
saves a compare after the CMPXCHG.
No functional change intended.
Signed-off-by: Uros Bizjak<ubizjak@xxxxxxxxx>
Cc: David Woodhouse<dwmw2@xxxxxxxxxxxxx>
Cc: Lu Baolu<baolu.lu@xxxxxxxxxxxxxxx>
Cc: Joerg Roedel<joro@xxxxxxxxxx>
Cc: Will Deacon<will@xxxxxxxxxx>
Cc: Robin Murphy<robin.murphy@xxxxxxx>
---
drivers/iommu/intel/iommu.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)