Commit a320412d authored by Julian Wiedmann's avatar Julian Wiedmann Committed by Vasily Gorbik

s390/qdio: use QDIO_BUFNR()

qdio.h recently gained a new helper macro that handles wrap-around on a
QDIO queue, use it.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 89d0180a
...@@ -355,14 +355,10 @@ static inline int multicast_outbound(struct qdio_q *q) ...@@ -355,14 +355,10 @@ static inline int multicast_outbound(struct qdio_q *q)
for (i = 0; i < irq_ptr->nr_output_qs && \ for (i = 0; i < irq_ptr->nr_output_qs && \
({ q = irq_ptr->output_qs[i]; 1; }); i++) ({ q = irq_ptr->output_qs[i]; 1; }); i++)
#define prev_buf(bufnr) \ #define add_buf(bufnr, inc) QDIO_BUFNR((bufnr) + (inc))
((bufnr + QDIO_MAX_BUFFERS_MASK) & QDIO_MAX_BUFFERS_MASK) #define next_buf(bufnr) add_buf(bufnr, 1)
#define next_buf(bufnr) \ #define sub_buf(bufnr, dec) QDIO_BUFNR((bufnr) - (dec))
((bufnr + 1) & QDIO_MAX_BUFFERS_MASK) #define prev_buf(bufnr) sub_buf(bufnr, 1)
#define add_buf(bufnr, inc) \
((bufnr + inc) & QDIO_MAX_BUFFERS_MASK)
#define sub_buf(bufnr, dec) \
((bufnr - dec) & QDIO_MAX_BUFFERS_MASK)
#define queue_irqs_enabled(q) \ #define queue_irqs_enabled(q) \
(test_bit(QDIO_QUEUE_IRQS_DISABLED, &q->u.in.queue_irq_state) == 0) (test_bit(QDIO_QUEUE_IRQS_DISABLED, &q->u.in.queue_irq_state) == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment