From: Julian Wiedmann <jwi@linux.ibm.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-s390@vger.kernel.org>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Stefan Raspl <raspl@linux.ibm.com>,
Ursula Braun <ubraun@linux.ibm.com>,
Julian Wiedmann <jwi@linux.ibm.com>
Subject: [PATCH net-next 08/10] s390/qeth: let qeth_notify_reply() set the notify reason
Date: Thu, 28 Mar 2019 16:39:26 +0100 [thread overview]
Message-ID: <20190328153928.87692-9-jwi@linux.ibm.com> (raw)
In-Reply-To: <20190328153928.87692-1-jwi@linux.ibm.com>
As trivial cleanup before adding more users to qeth_notify_reply(),
move the setup of reply->rc from the caller into the helper.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 093464567025..fee787fbc1d4 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -577,8 +577,9 @@ static void qeth_dequeue_reply(struct qeth_card *card, struct qeth_reply *reply)
spin_unlock_irq(&card->lock);
}
-static void qeth_notify_reply(struct qeth_reply *reply)
+static void qeth_notify_reply(struct qeth_reply *reply, int reason)
{
+ reply->rc = reason;
complete(&reply->received);
}
@@ -664,10 +665,8 @@ void qeth_clear_ipacmd_list(struct qeth_card *card)
QETH_CARD_TEXT(card, 4, "clipalst");
spin_lock_irqsave(&card->lock, flags);
- list_for_each_entry(reply, &card->cmd_waiter_list, list) {
- reply->rc = -EIO;
- qeth_notify_reply(reply);
- }
+ list_for_each_entry(reply, &card->cmd_waiter_list, list)
+ qeth_notify_reply(reply, -EIO);
spin_unlock_irqrestore(&card->lock, flags);
}
EXPORT_SYMBOL_GPL(qeth_clear_ipacmd_list);
@@ -744,10 +743,8 @@ static void qeth_cancel_cmd(struct qeth_cmd_buffer *iob, int rc)
{
struct qeth_reply *reply = iob->reply;
- if (reply) {
- reply->rc = rc;
- qeth_notify_reply(reply);
- }
+ if (reply)
+ qeth_notify_reply(reply, rc);
qeth_release_buffer(iob->channel, iob);
}
@@ -847,11 +844,8 @@ static void qeth_issue_next_read_cb(struct qeth_card *card,
}
}
- if (rc <= 0) {
- reply->rc = rc;
- qeth_notify_reply(reply);
- }
-
+ if (rc <= 0)
+ qeth_notify_reply(reply, rc);
qeth_put_reply(reply);
out:
--
2.16.4
next prev parent reply other threads:[~2019-03-28 15:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-28 15:39 [PATCH net-next 00/10] s390/qeth: updates 2019-03-28 Julian Wiedmann
2019-03-28 15:39 ` [PATCH net-next 01/10] s390/qeth: defer RX modesetting Julian Wiedmann
2019-03-28 15:39 ` [PATCH net-next 02/10] s390/qeth: remove locking for RX modeset cache Julian Wiedmann
2019-03-28 15:39 ` [PATCH net-next 03/10] s390/qeth: add wrapper for IP table access Julian Wiedmann
2019-03-28 15:39 ` [PATCH net-next 04/10] s390/qeth: defer IPv6 address notifier events Julian Wiedmann
2019-03-28 15:39 ` [PATCH net-next 05/10] s390/qeth: convert IP table spinlock to mutex Julian Wiedmann
2019-03-28 15:39 ` [PATCH net-next 06/10] s390/qeth: don't poll for cmd IO completion Julian Wiedmann
2019-03-28 15:39 ` [PATCH net-next 07/10] s390/qeth: clarify default cmd callback Julian Wiedmann
2019-03-28 15:39 ` Julian Wiedmann [this message]
2019-03-28 15:39 ` [PATCH net-next 09/10] s390/qeth: use callback to finalize cmd Julian Wiedmann
2019-03-28 15:39 ` [PATCH net-next 10/10] s390/qeth: send IDX cmds via qeth_send_control_data() Julian Wiedmann
2019-03-28 19:58 ` [PATCH net-next 00/10] s390/qeth: updates 2019-03-28 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190328153928.87692-9-jwi@linux.ibm.com \
--to=jwi@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=raspl@linux.ibm.com \
--cc=schwidefsky@de.ibm.com \
--cc=ubraun@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).