Commit b439044b authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

s390/qeth: remove redundant if-clause in RX poll code

Whenever all completed RX buffers have been processed
(ie. rx->b_count == 0), we call down to the HW layer to scan for
additional buffers. If no further buffers are available, the code
breaks out of the while-loop.

So we never reach the 'process an RX buffer' step with rx->b_count == 0,
eliminate that check and one level of indentation.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 781b9a18
...@@ -5536,6 +5536,10 @@ static unsigned int qeth_rx_poll(struct qeth_card *card, int budget) ...@@ -5536,6 +5536,10 @@ static unsigned int qeth_rx_poll(struct qeth_card *card, int budget)
unsigned int work_done = 0; unsigned int work_done = 0;
while (budget > 0) { while (budget > 0) {
struct qeth_qdio_buffer *buffer;
unsigned int skbs_done = 0;
bool done = false;
/* Fetch completed RX buffers: */ /* Fetch completed RX buffers: */
if (!card->rx.b_count) { if (!card->rx.b_count) {
card->rx.qdio_err = 0; card->rx.qdio_err = 0;
...@@ -5549,17 +5553,12 @@ static unsigned int qeth_rx_poll(struct qeth_card *card, int budget) ...@@ -5549,17 +5553,12 @@ static unsigned int qeth_rx_poll(struct qeth_card *card, int budget)
} }
/* Process one completed RX buffer: */ /* Process one completed RX buffer: */
if (card->rx.b_count) {
struct qeth_qdio_buffer *buffer;
unsigned int skbs_done = 0;
bool done = false;
buffer = &card->qdio.in_q->bufs[card->rx.b_index]; buffer = &card->qdio.in_q->bufs[card->rx.b_index];
if (!(card->rx.qdio_err && if (!(card->rx.qdio_err &&
qeth_check_qdio_errors(card, buffer->buffer, qeth_check_qdio_errors(card, buffer->buffer,
card->rx.qdio_err, "qinerr"))) card->rx.qdio_err, "qinerr")))
skbs_done = qeth_extract_skbs(card, budget, skbs_done = qeth_extract_skbs(card, budget, buffer,
buffer, &done); &done);
else else
done = true; done = true;
...@@ -5568,19 +5567,16 @@ static unsigned int qeth_rx_poll(struct qeth_card *card, int budget) ...@@ -5568,19 +5567,16 @@ static unsigned int qeth_rx_poll(struct qeth_card *card, int budget)
if (done) { if (done) {
QETH_CARD_STAT_INC(card, rx_bufs); QETH_CARD_STAT_INC(card, rx_bufs);
qeth_put_buffer_pool_entry(card, qeth_put_buffer_pool_entry(card, buffer->pool_entry);
buffer->pool_entry);
qeth_queue_input_buffer(card, card->rx.b_index); qeth_queue_input_buffer(card, card->rx.b_index);
card->rx.b_count--; card->rx.b_count--;
/* Step forward to next buffer: */ /* Step forward to next buffer: */
card->rx.b_index = card->rx.b_index = QDIO_BUFNR(card->rx.b_index + 1);
QDIO_BUFNR(card->rx.b_index + 1);
card->rx.buf_element = 0; card->rx.buf_element = 0;
card->rx.e_offset = 0; card->rx.e_offset = 0;
} }
} }
}
return work_done; return work_done;
} }
......
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