Skip to content

Commit 988a747

Browse files
julianwiedmanndavem330
authored andcommitted
s390/qeth: clarify default cmd callback
Current code makes it look like qeth_send_control_data_cb() is some sort of default callback for all cmds. But in practice, it is only used for half of the cmd buffers we issue. Reduce the confusion by only setting this callback for cmds that actually want it, and while at it give the callback a name that matches the established naming scheme. Signed-off-by: Julian Wiedmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 782e4a7 commit 988a747

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

drivers/s390/net/qeth_core_main.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ static struct kmem_cache *qeth_qdio_outbuf_cache;
6161
static struct device *qeth_core_root_dev;
6262
static struct lock_class_key qdio_out_skb_queue_key;
6363

64-
static void qeth_send_control_data_cb(struct qeth_card *card,
65-
struct qeth_channel *channel,
66-
struct qeth_cmd_buffer *iob);
64+
static void qeth_issue_next_read_cb(struct qeth_card *card,
65+
struct qeth_channel *channel,
66+
struct qeth_cmd_buffer *iob);
6767
static struct qeth_cmd_buffer *qeth_get_buffer(struct qeth_channel *);
6868
static void qeth_free_buffer_pool(struct qeth_card *);
6969
static int qeth_qdio_establish(struct qeth_card *);
@@ -511,7 +511,9 @@ static int __qeth_issue_next_read(struct qeth_card *card)
511511
CARD_DEVID(card));
512512
return -ENOMEM;
513513
}
514+
514515
qeth_setup_ccw(channel->ccw, CCW_CMD_READ, QETH_BUFSIZE, iob->data);
516+
iob->callback = qeth_issue_next_read_cb;
515517
QETH_CARD_TEXT(card, 6, "noirqpnd");
516518
rc = ccw_device_start(channel->ccwdev, channel->ccw,
517519
(addr_t) iob, 0, 0);
@@ -721,7 +723,7 @@ void qeth_release_buffer(struct qeth_channel *channel,
721723

722724
spin_lock_irqsave(&channel->iob_lock, flags);
723725
iob->state = BUF_STATE_FREE;
724-
iob->callback = qeth_send_control_data_cb;
726+
iob->callback = NULL;
725727
if (iob->reply) {
726728
qeth_put_reply(iob->reply);
727729
iob->reply = NULL;
@@ -779,9 +781,9 @@ void qeth_clear_cmd_buffers(struct qeth_channel *channel)
779781
}
780782
EXPORT_SYMBOL_GPL(qeth_clear_cmd_buffers);
781783

782-
static void qeth_send_control_data_cb(struct qeth_card *card,
783-
struct qeth_channel *channel,
784-
struct qeth_cmd_buffer *iob)
784+
static void qeth_issue_next_read_cb(struct qeth_card *card,
785+
struct qeth_channel *channel,
786+
struct qeth_cmd_buffer *iob)
785787
{
786788
struct qeth_ipa_cmd *cmd = NULL;
787789
struct qeth_reply *reply = NULL;
@@ -1272,7 +1274,6 @@ static int qeth_setup_channel(struct qeth_channel *channel, bool alloc_buffers)
12721274
break;
12731275
channel->iob[cnt].state = BUF_STATE_FREE;
12741276
channel->iob[cnt].channel = channel;
1275-
channel->iob[cnt].callback = qeth_send_control_data_cb;
12761277
}
12771278
if (cnt < QETH_CMD_BUFFER_NO) {
12781279
qeth_clean_channel(channel);

0 commit comments

Comments
 (0)