Skip to content

Commit 61e0446

Browse files
julianwiedmanndavem330
authored andcommitted
s390/qeth: let qeth_notify_reply() set the notify reason
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 988a747 commit 61e0446

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

drivers/s390/net/qeth_core_main.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,9 @@ static void qeth_dequeue_reply(struct qeth_card *card, struct qeth_reply *reply)
577577
spin_unlock_irq(&card->lock);
578578
}
579579

580-
static void qeth_notify_reply(struct qeth_reply *reply)
580+
static void qeth_notify_reply(struct qeth_reply *reply, int reason)
581581
{
582+
reply->rc = reason;
582583
complete(&reply->received);
583584
}
584585

@@ -664,10 +665,8 @@ void qeth_clear_ipacmd_list(struct qeth_card *card)
664665
QETH_CARD_TEXT(card, 4, "clipalst");
665666

666667
spin_lock_irqsave(&card->lock, flags);
667-
list_for_each_entry(reply, &card->cmd_waiter_list, list) {
668-
reply->rc = -EIO;
669-
qeth_notify_reply(reply);
670-
}
668+
list_for_each_entry(reply, &card->cmd_waiter_list, list)
669+
qeth_notify_reply(reply, -EIO);
671670
spin_unlock_irqrestore(&card->lock, flags);
672671
}
673672
EXPORT_SYMBOL_GPL(qeth_clear_ipacmd_list);
@@ -744,10 +743,8 @@ static void qeth_cancel_cmd(struct qeth_cmd_buffer *iob, int rc)
744743
{
745744
struct qeth_reply *reply = iob->reply;
746745

747-
if (reply) {
748-
reply->rc = rc;
749-
qeth_notify_reply(reply);
750-
}
746+
if (reply)
747+
qeth_notify_reply(reply, rc);
751748
qeth_release_buffer(iob->channel, iob);
752749
}
753750

@@ -847,11 +844,8 @@ static void qeth_issue_next_read_cb(struct qeth_card *card,
847844
}
848845
}
849846

850-
if (rc <= 0) {
851-
reply->rc = rc;
852-
qeth_notify_reply(reply);
853-
}
854-
847+
if (rc <= 0)
848+
qeth_notify_reply(reply, rc);
855849
qeth_put_reply(reply);
856850

857851
out:

0 commit comments

Comments
 (0)