]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
nvme-tcp: cleanup nvme_tcp_recv_pdu
authorSagi Grimberg <sagi@grimberg.me>
Fri, 19 Jul 2019 19:46:46 +0000 (12:46 -0700)
committerSagi Grimberg <sagi@grimberg.me>
Thu, 29 Aug 2019 19:55:00 +0000 (12:55 -0700)
Can return directly in the switch statement

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/tcp.c

index cf2eaf834b364c125ef9bb55207f75d82b26af25..2c5df86882cc388ae33ea559a4ecf64ce8015706 100644 (file)
@@ -608,23 +608,18 @@ static int nvme_tcp_recv_pdu(struct nvme_tcp_queue *queue, struct sk_buff *skb,
 
        switch (hdr->type) {
        case nvme_tcp_c2h_data:
-               ret = nvme_tcp_handle_c2h_data(queue, (void *)queue->pdu);
-               break;
+               return nvme_tcp_handle_c2h_data(queue, (void *)queue->pdu);
        case nvme_tcp_rsp:
                nvme_tcp_init_recv_ctx(queue);
-               ret = nvme_tcp_handle_comp(queue, (void *)queue->pdu);
-               break;
+               return nvme_tcp_handle_comp(queue, (void *)queue->pdu);
        case nvme_tcp_r2t:
                nvme_tcp_init_recv_ctx(queue);
-               ret = nvme_tcp_handle_r2t(queue, (void *)queue->pdu);
-               break;
+               return nvme_tcp_handle_r2t(queue, (void *)queue->pdu);
        default:
                dev_err(queue->ctrl->ctrl.device,
                        "unsupported pdu type (%d)\n", hdr->type);
                return -EINVAL;
        }
-
-       return ret;
 }
 
 static inline void nvme_tcp_end_request(struct request *rq, u16 status)