Testing if the ring is empty is as simple as comparing the producer and consumer pointers.
Checkpatch complains about existing coding style violations, so the first part of the patch fixes those, and contains no functional changes. Morten Brørup (2): ring: coding style cleanup ring: empty optimization lib/librte_ring/rte_ring.c | 4 +-- lib/librte_ring/rte_ring.h | 46 +++++++++++++++++---------------- lib/librte_ring/rte_ring_elem.h | 10 +++---- lib/librte_ring/rte_ring_hts.h | 8 +++--- lib/librte_ring/rte_ring_rts.h | 8 +++--- 5 files changed, 39 insertions(+), 37 deletions(-) -- 2.17.1