Commit 6be18260 authored by Sagi Grimberg's avatar Sagi Grimberg

nvme-tcp: cleanup nvme_tcp_recv_pdu

Can return directly in the switch statement
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
parent 3532e722
...@@ -608,23 +608,18 @@ static int nvme_tcp_recv_pdu(struct nvme_tcp_queue *queue, struct sk_buff *skb, ...@@ -608,23 +608,18 @@ static int nvme_tcp_recv_pdu(struct nvme_tcp_queue *queue, struct sk_buff *skb,
switch (hdr->type) { switch (hdr->type) {
case nvme_tcp_c2h_data: case nvme_tcp_c2h_data:
ret = nvme_tcp_handle_c2h_data(queue, (void *)queue->pdu); return nvme_tcp_handle_c2h_data(queue, (void *)queue->pdu);
break;
case nvme_tcp_rsp: case nvme_tcp_rsp:
nvme_tcp_init_recv_ctx(queue); nvme_tcp_init_recv_ctx(queue);
ret = nvme_tcp_handle_comp(queue, (void *)queue->pdu); return nvme_tcp_handle_comp(queue, (void *)queue->pdu);
break;
case nvme_tcp_r2t: case nvme_tcp_r2t:
nvme_tcp_init_recv_ctx(queue); nvme_tcp_init_recv_ctx(queue);
ret = nvme_tcp_handle_r2t(queue, (void *)queue->pdu); return nvme_tcp_handle_r2t(queue, (void *)queue->pdu);
break;
default: default:
dev_err(queue->ctrl->ctrl.device, dev_err(queue->ctrl->ctrl.device,
"unsupported pdu type (%d)\n", hdr->type); "unsupported pdu type (%d)\n", hdr->type);
return -EINVAL; return -EINVAL;
} }
return ret;
} }
static inline void nvme_tcp_end_request(struct request *rq, u16 status) static inline void nvme_tcp_end_request(struct request *rq, u16 status)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment