s390/ap: Replace xchg() with WRITE_ONCE()
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 25 Nov 2024 11:54:30 +0000 (12:54 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Wed, 27 Nov 2024 11:55:15 +0000 (12:55 +0100)
The result of xchg() is not used, and in addition it is used on a one byte
memory area which leads to inefficient code.

Use WRITE_ONCE() instead to achieve the same result with much less
generated code.

Acked-by: Harald Freudenberger <freude@linux.ibm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/crypto/ap_bus.c

index e146389..26e1ea1 100644 (file)
@@ -453,7 +453,7 @@ static void ap_tasklet_fn(unsigned long dummy)
         * important that no requests on any AP get lost.
         */
        if (ap_irq_flag)
-               xchg(ap_airq.lsi_ptr, 0);
+               WRITE_ONCE(*ap_airq.lsi_ptr, 0);
 
        spin_lock_bh(&ap_queues_lock);
        hash_for_each(ap_queues, bkt, aq, hnode) {