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

s390/qeth: don't call INIT_LIST_HEAD() on iob's list entry

INIT_LIST_HEAD() only needs to be called on actual list heads.
While at it clarify the naming of the field.
Suggested-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent af3f4a85
...@@ -624,7 +624,7 @@ struct qeth_reply { ...@@ -624,7 +624,7 @@ struct qeth_reply {
}; };
struct qeth_cmd_buffer { struct qeth_cmd_buffer {
struct list_head list; struct list_head list_entry;
struct completion done; struct completion done;
spinlock_t lock; spinlock_t lock;
unsigned int length; unsigned int length;
......
...@@ -615,7 +615,7 @@ static void qeth_enqueue_cmd(struct qeth_card *card, ...@@ -615,7 +615,7 @@ static void qeth_enqueue_cmd(struct qeth_card *card,
struct qeth_cmd_buffer *iob) struct qeth_cmd_buffer *iob)
{ {
spin_lock_irq(&card->lock); spin_lock_irq(&card->lock);
list_add_tail(&iob->list, &card->cmd_waiter_list); list_add_tail(&iob->list_entry, &card->cmd_waiter_list);
spin_unlock_irq(&card->lock); spin_unlock_irq(&card->lock);
} }
...@@ -623,7 +623,7 @@ static void qeth_dequeue_cmd(struct qeth_card *card, ...@@ -623,7 +623,7 @@ static void qeth_dequeue_cmd(struct qeth_card *card,
struct qeth_cmd_buffer *iob) struct qeth_cmd_buffer *iob)
{ {
spin_lock_irq(&card->lock); spin_lock_irq(&card->lock);
list_del(&iob->list); list_del(&iob->list_entry);
spin_unlock_irq(&card->lock); spin_unlock_irq(&card->lock);
} }
...@@ -977,7 +977,7 @@ static void qeth_clear_ipacmd_list(struct qeth_card *card) ...@@ -977,7 +977,7 @@ static void qeth_clear_ipacmd_list(struct qeth_card *card)
QETH_CARD_TEXT(card, 4, "clipalst"); QETH_CARD_TEXT(card, 4, "clipalst");
spin_lock_irqsave(&card->lock, flags); spin_lock_irqsave(&card->lock, flags);
list_for_each_entry(iob, &card->cmd_waiter_list, list) list_for_each_entry(iob, &card->cmd_waiter_list, list_entry)
qeth_notify_cmd(iob, -ECANCELED); qeth_notify_cmd(iob, -ECANCELED);
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
} }
...@@ -1047,7 +1047,6 @@ struct qeth_cmd_buffer *qeth_alloc_cmd(struct qeth_channel *channel, ...@@ -1047,7 +1047,6 @@ struct qeth_cmd_buffer *qeth_alloc_cmd(struct qeth_channel *channel,
init_completion(&iob->done); init_completion(&iob->done);
spin_lock_init(&iob->lock); spin_lock_init(&iob->lock);
INIT_LIST_HEAD(&iob->list);
refcount_set(&iob->ref_count, 1); refcount_set(&iob->ref_count, 1);
iob->channel = channel; iob->channel = channel;
iob->timeout = timeout; iob->timeout = timeout;
...@@ -1094,7 +1093,7 @@ static void qeth_issue_next_read_cb(struct qeth_card *card, ...@@ -1094,7 +1093,7 @@ static void qeth_issue_next_read_cb(struct qeth_card *card,
/* match against pending cmd requests */ /* match against pending cmd requests */
spin_lock_irqsave(&card->lock, flags); spin_lock_irqsave(&card->lock, flags);
list_for_each_entry(tmp, &card->cmd_waiter_list, list) { list_for_each_entry(tmp, &card->cmd_waiter_list, list_entry) {
if (tmp->match && tmp->match(tmp, iob)) { if (tmp->match && tmp->match(tmp, iob)) {
request = tmp; request = tmp;
/* take the object outside the lock */ /* take the object outside the lock */
......
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