Use __atomic_fetch_{add,and,or,sub,xor} instead of
__atomic_{add,and,or,sub,xor}_fetch adding the necessary code to
allow consumption of the resulting value.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
drivers/net/cxgbe/clip_tbl.c | 2 +-
drivers/net/cxgbe/mps_tcam.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
@@ -55,7 +55,7 @@ void cxgbe_clip_release(struct rte_eth_dev *dev, struct clip_entry *ce)
int ret;
t4_os_lock(&ce->lock);
- if (__atomic_sub_fetch(&ce->refcnt, 1, __ATOMIC_RELAXED) == 0) {
+ if (__atomic_fetch_sub(&ce->refcnt, 1, __ATOMIC_RELAXED) - 1 == 0) {
ret = clip6_release_mbox(dev, ce->addr);
if (ret)
dev_debug(adap, "CLIP FW DEL CMD failed: %d", ret);
@@ -195,7 +195,7 @@ int cxgbe_mpstcam_remove(struct port_info *pi, u16 idx)
entry->mask, idx, 1, pi->port_id,
false);
else
- ret = __atomic_sub_fetch(&entry->refcnt, 1, __ATOMIC_RELAXED);
+ ret = __atomic_fetch_sub(&entry->refcnt, 1, __ATOMIC_RELAXED) - 1;
if (ret == 0) {
reset_mpstcam_entry(entry);