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: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
Родитель
89d0180a60
Коммит
a320412dbb
|
@ -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)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче