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

s390/qeth: use a static Output Queue array

qeth dynamically allocates an array for storing pointers to its
Output Queue structures. Switch this to a static array - we are
currently limited to 4 Output Queues, so shrinking the qeth_qdio_info
struct by just a few bytes doesn't justify the additional complexity.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0aa35a36
...@@ -528,7 +528,7 @@ struct qeth_qdio_info { ...@@ -528,7 +528,7 @@ struct qeth_qdio_info {
/* output */ /* output */
int no_out_queues; int no_out_queues;
struct qeth_qdio_out_q **out_qs; struct qeth_qdio_out_q *out_qs[QETH_MAX_QUEUES];
struct qdio_outbuf_state *out_bufstates; struct qdio_outbuf_state *out_bufstates;
/* priority queueing */ /* priority queueing */
......
...@@ -2433,12 +2433,6 @@ static int qeth_alloc_qdio_buffers(struct qeth_card *card) ...@@ -2433,12 +2433,6 @@ static int qeth_alloc_qdio_buffers(struct qeth_card *card)
goto out_freeinq; goto out_freeinq;
/* outbound */ /* outbound */
card->qdio.out_qs =
kcalloc(card->qdio.no_out_queues,
sizeof(struct qeth_qdio_out_q *),
GFP_KERNEL);
if (!card->qdio.out_qs)
goto out_freepool;
for (i = 0; i < card->qdio.no_out_queues; ++i) { for (i = 0; i < card->qdio.no_out_queues; ++i) {
card->qdio.out_qs[i] = qeth_alloc_qdio_out_buf(); card->qdio.out_qs[i] = qeth_alloc_qdio_out_buf();
if (!card->qdio.out_qs[i]) if (!card->qdio.out_qs[i])
...@@ -2468,11 +2462,10 @@ static int qeth_alloc_qdio_buffers(struct qeth_card *card) ...@@ -2468,11 +2462,10 @@ static int qeth_alloc_qdio_buffers(struct qeth_card *card)
card->qdio.out_qs[i]->bufs[j] = NULL; card->qdio.out_qs[i]->bufs[j] = NULL;
} }
out_freeoutq: out_freeoutq:
while (i > 0) while (i > 0) {
qeth_free_output_queue(card->qdio.out_qs[--i]); qeth_free_output_queue(card->qdio.out_qs[--i]);
kfree(card->qdio.out_qs); card->qdio.out_qs[i] = NULL;
card->qdio.out_qs = NULL; }
out_freepool:
qeth_free_buffer_pool(card); qeth_free_buffer_pool(card);
out_freeinq: out_freeinq:
qeth_free_qdio_queue(card->qdio.in_q); qeth_free_qdio_queue(card->qdio.in_q);
...@@ -2501,11 +2494,9 @@ static void qeth_free_qdio_buffers(struct qeth_card *card) ...@@ -2501,11 +2494,9 @@ static void qeth_free_qdio_buffers(struct qeth_card *card)
/* inbound buffer pool */ /* inbound buffer pool */
qeth_free_buffer_pool(card); qeth_free_buffer_pool(card);
/* free outbound qdio_qs */ /* free outbound qdio_qs */
if (card->qdio.out_qs) { for (i = 0; i < card->qdio.no_out_queues; i++) {
for (i = 0; i < card->qdio.no_out_queues; i++) qeth_free_output_queue(card->qdio.out_qs[i]);
qeth_free_output_queue(card->qdio.out_qs[i]); card->qdio.out_qs[i] = NULL;
kfree(card->qdio.out_qs);
card->qdio.out_qs = NULL;
} }
} }
......
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