summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
eb45627)
The local variable i is only used for loop control so define it in
the enqueue and dequeue blocks directly, rather than at the function
level.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
* Placed here since identical code needed in both
* single and multi producer enqueue functions */
#define ENQUEUE_PTRS() do { \
* Placed here since identical code needed in both
* single and multi producer enqueue functions */
#define ENQUEUE_PTRS() do { \
const uint32_t size = r->size; \
uint32_t idx = prod_head & mask; \
if (likely(idx + n < size)) { \
const uint32_t size = r->size; \
uint32_t idx = prod_head & mask; \
if (likely(idx + n < size)) { \
* Placed here since identical code needed in both
* single and multi consumer dequeue functions */
#define DEQUEUE_PTRS() do { \
* Placed here since identical code needed in both
* single and multi consumer dequeue functions */
#define DEQUEUE_PTRS() do { \
uint32_t idx = cons_head & mask; \
const uint32_t size = r->size; \
if (likely(idx + n < size)) { \
uint32_t idx = cons_head & mask; \
const uint32_t size = r->size; \
if (likely(idx + n < size)) { \
uint32_t cons_tail, free_entries;
const unsigned int max = n;
int success;
uint32_t cons_tail, free_entries;
const unsigned int max = n;
int success;
uint32_t mask = r->mask;
/* move prod.head atomically */
uint32_t mask = r->mask;
/* move prod.head atomically */
{
uint32_t prod_head, cons_tail;
uint32_t prod_next, free_entries;
{
uint32_t prod_head, cons_tail;
uint32_t prod_next, free_entries;
uint32_t mask = r->mask;
prod_head = r->prod.head;
uint32_t mask = r->mask;
prod_head = r->prod.head;
uint32_t cons_next, entries;
const unsigned max = n;
int success;
uint32_t cons_next, entries;
const unsigned max = n;
int success;
uint32_t mask = r->mask;
/* move cons.head atomically */
uint32_t mask = r->mask;
/* move cons.head atomically */
{
uint32_t cons_head, prod_tail;
uint32_t cons_next, entries;
{
uint32_t cons_head, prod_tail;
uint32_t cons_next, entries;
uint32_t mask = r->mask;
cons_head = r->cons.head;
uint32_t mask = r->mask;
cons_head = r->cons.head;