Skip to content

Commit

Permalink
nvmet-tcp: simplify nvmet_process_resp_list
Browse files Browse the repository at this point in the history
We can make it shorter and simpler without some redundant checks.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Sagi Grimberg authored and Christoph Hellwig committed Jul 8, 2020
1 parent 122e5b9 commit b8a12e9
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions drivers/nvme/target/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,17 +459,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++;
}
}
Expand Down

0 comments on commit b8a12e9

Please sign in to comment.