Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: minwoo.im.dev@gmail.com (Minwoo Im)
Subject: [PATCH] nvme-tcp: cleanup nvme_tcp_recv_pdu
Date: Sat, 20 Jul 2019 17:14:44 +0900	[thread overview]
Message-ID: <20190720081444.GF22395@minwoo-desktop> (raw)
In-Reply-To: <20190719194646.24826-1-sagi@grimberg.me>

On 19-07-19 12:46:46, Sagi Grimberg wrote:
> Can return directly in the switch statement
> 
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> ---
>  drivers/nvme/host/tcp.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
> index 361e4bd6338e..8d4965031399 100644
> --- a/drivers/nvme/host/tcp.c
> +++ b/drivers/nvme/host/tcp.c
> @@ -611,23 +611,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;
>  }

For the non-functional changes here by early-return:

Reviewed-by: Minwoo Im <minwoo.im.dev at gmail.com>

      reply	other threads:[~2019-07-20  8:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-19 19:46 [PATCH] nvme-tcp: cleanup nvme_tcp_recv_pdu Sagi Grimberg
2019-07-20  8:14 ` Minwoo Im [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190720081444.GF22395@minwoo-desktop \
    --to=minwoo.im.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox