From da6e33875ca44eea6306078a428473f60f1bd237 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Tue, 21 Aug 2018 23:33:38 +0000 Subject: [PATCH] cxgbe(4): Be explicit about ignoring the return value of cmpset in some cases. Reported by: Coverity (CIDs 1009398, 1009400, 1009401, 1357325, 1394783). All false positives. Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_netmap.c | 2 +- sys/dev/cxgbe/t4_sge.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c index 992e49374184..be09f7ffda11 100644 --- a/sys/dev/cxgbe/t4_netmap.c +++ b/sys/dev/cxgbe/t4_netmap.c @@ -385,7 +385,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi, struct ifnet *ifp, t4_write_reg(sc, sc->sge_kdoorbell_reg, nm_rxq->fl_db_val | V_PIDX(j)); - atomic_cmpset_int(&nm_rxq->nm_state, NM_OFF, NM_ON); + (void) atomic_cmpset_int(&nm_rxq->nm_state, NM_OFF, NM_ON); } for_each_nm_txq(vi, i, nm_txq) { diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 0e2f8d45feb9..1cedf3ebd33f 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -1383,7 +1383,7 @@ t4_intr_evt(void *arg) if (atomic_cmpset_int(&iq->state, IQS_IDLE, IQS_BUSY)) { service_iq(iq, 0); - atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); + (void) atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); } } @@ -1397,7 +1397,7 @@ t4_intr(void *arg) if (atomic_cmpset_int(&iq->state, IQS_IDLE, IQS_BUSY)) { service_iq_fl(iq, 0); - atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); + (void) atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); } } @@ -1412,7 +1412,7 @@ t4_nm_intr(void *arg) if (atomic_cmpset_int(&nm_rxq->nm_state, NM_ON, NM_BUSY)) { service_nm_rxq(nm_rxq); - atomic_cmpset_int(&nm_rxq->nm_state, NM_BUSY, NM_ON); + (void) atomic_cmpset_int(&nm_rxq->nm_state, NM_BUSY, NM_ON); } } @@ -1498,7 +1498,7 @@ service_iq(struct sge_iq *iq, int budget) if (atomic_cmpset_int(&q->state, IQS_IDLE, IQS_BUSY)) { if (service_iq_fl(q, q->qsize / 16) == 0) { - atomic_cmpset_int(&q->state, + (void) atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); } else { STAILQ_INSERT_TAIL(&iql, q, @@ -1546,7 +1546,7 @@ service_iq(struct sge_iq *iq, int budget) q = STAILQ_FIRST(&iql); STAILQ_REMOVE_HEAD(&iql, link); if (service_iq_fl(q, q->qsize / 8) == 0) - atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); + (void) atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); else STAILQ_INSERT_TAIL(&iql, q, link); }