All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvmet-tcp: simplify nvmet_process_resp_list
@ 2020-06-24 19:27 Sagi Grimberg
  2020-06-26  8:28 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Sagi Grimberg @ 2020-06-24 19:27 UTC (permalink / raw)
  To: linux-nvme, Christoph Hellwig, Chaitanya Kulkarni

We can make it shorter and simpler without some
redundant checks.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
Christoph, your version looks so good that I want to
take it to the target code as well.

 drivers/nvme/target/tcp.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 38eb8797b3c0..dfcbc6522aba 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -463,17 +463,11 @@ static void nvmet_setup_response_pdu(struct nvmet_tcp_cmd *cmd)
 static void nvmet_tcp_process_resp_list(struct nvmet_tcp_queue *queue)
 {
 	struct llist_node *node;
+	struct nvmet_tcp_cmd *cmd;
 
-	node = llist_del_all(&queue->resp_list);
-	if (!node)
-		return;
-
-	while (node) {
-		struct nvmet_tcp_cmd *cmd = llist_entry(node,
-					struct nvmet_tcp_cmd, lentry);
-
+	for (node = llist_del_all(&queue->resp_list); node; node = node->next) {
+		cmd = llist_entry(node, struct nvmet_tcp_cmd, lentry);
 		list_add(&cmd->entry, &queue->resp_send_list);
-		node = node->next;
 		queue->send_list_len++;
 	}
 }
-- 
2.25.1


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nvmet-tcp: simplify nvmet_process_resp_list
  2020-06-24 19:27 [PATCH] nvmet-tcp: simplify nvmet_process_resp_list Sagi Grimberg
@ 2020-06-26  8:28 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2020-06-26  8:28 UTC (permalink / raw)
  To: Sagi Grimberg; +Cc: Chaitanya Kulkarni, Christoph Hellwig, linux-nvme

Thanks,

applied to nvme-5.9.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-26  9:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24 19:27 [PATCH] nvmet-tcp: simplify nvmet_process_resp_list Sagi Grimberg
2020-06-26  8:28 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.