Use __atomic_fetch_{add,and,or,sub,xor} instead of
__atomic_{add,and,or,sub,xor}_fetch when we have no interest in the
result of the operation.

Reduces unnecessary codegen that provided the result of the atomic
operation that was not used.

Change brings closer alignment with atomics available in C11 standard
and will reduce review effort when they are integrated.

Signed-off-by: Tyler Retzlaff <roret...@linux.microsoft.com>
Acked-by: Morten Brørup <m...@smartsharesystems.com>
---
 drivers/net/octeontx/octeontx_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/octeontx/octeontx_ethdev.c 
b/drivers/net/octeontx/octeontx_ethdev.c
index d52a3e7..e00298e 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -1581,7 +1581,7 @@ static void build_xstat_names(struct rte_eth_xstat_name 
*xstat_names)
        nic->pko_vfid = pko_vfid;
        nic->port_id = port;
        nic->evdev = evdev;
-       __atomic_add_fetch(&evdev_refcnt, 1, __ATOMIC_ACQUIRE);
+       __atomic_fetch_add(&evdev_refcnt, 1, __ATOMIC_ACQUIRE);
 
        res = octeontx_port_open(nic);
        if (res < 0)
-- 
1.8.3.1

Reply via email to