Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
To: samirweng1979 <samirweng1979@163.com>, k.opasiak@samsung.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	wengjianfeng <wengjianfeng@yulong.com>
Subject: Re: [PATCH] nfc: s3fwrn5: remove unnecessary label
Date: Mon, 26 Jul 2021 09:55:27 +0200	[thread overview]
Message-ID: <94177278-c8fe-89f3-97f0-7010078b9ba2@canonical.com> (raw)
In-Reply-To: <20210726032917.30076-1-samirweng1979@163.com>

On 26/07/2021 05:29, samirweng1979 wrote:
> From: wengjianfeng <wengjianfeng@yulong.com>
> 
> Simplify the code by removing unnecessary label and returning directly.
> 
> Signed-off-by: wengjianfeng <wengjianfeng@yulong.com>
> ---
>  drivers/nfc/s3fwrn5/firmware.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

Best regards,
Krzysztof

> diff --git a/drivers/nfc/s3fwrn5/firmware.c b/drivers/nfc/s3fwrn5/firmware.c
> index eb5d7a5b..1421ffd 100644
> --- a/drivers/nfc/s3fwrn5/firmware.c
> +++ b/drivers/nfc/s3fwrn5/firmware.c
> @@ -421,10 +421,9 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info)
>  
>  	tfm = crypto_alloc_shash("sha1", 0, 0);
>  	if (IS_ERR(tfm)) {
> -		ret = PTR_ERR(tfm);
>  		dev_err(&fw_info->ndev->nfc_dev->dev,
>  			"Cannot allocate shash (code=%d)\n", ret);
> -		goto out;
> +		return PTR_ERR(tfm);
>  	}
>  
>  	ret = crypto_shash_tfm_digest(tfm, fw->image, image_size, hash_data);
> @@ -433,7 +432,7 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info)
>  	if (ret) {
>  		dev_err(&fw_info->ndev->nfc_dev->dev,
>  			"Cannot compute hash (code=%d)\n", ret);
> -		goto out;
> +		return ret;
>  	}
>  
>  	/* Firmware update process */
> @@ -446,7 +445,7 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info)
>  	if (ret < 0) {
>  		dev_err(&fw_info->ndev->nfc_dev->dev,
>  			"Unable to enter update mode\n");
> -		goto out;
> +		return ret;
>  	}
>  
>  	for (off = 0; off < image_size; off += fw_info->sector_size) {
> @@ -455,7 +454,7 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info)
>  		if (ret < 0) {
>  			dev_err(&fw_info->ndev->nfc_dev->dev,
>  				"Firmware update error (code=%d)\n", ret);
> -			goto out;
> +			return ret;
>  		}
>  	}
>  
> @@ -463,13 +462,12 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info)
>  	if (ret < 0) {
>  		dev_err(&fw_info->ndev->nfc_dev->dev,
>  			"Unable to complete update mode\n");
> -		goto out;
> +		return ret;
>  	}
>  
>  	dev_info(&fw_info->ndev->nfc_dev->dev,
>  		"Firmware update: success\n");
>  
> -out:
>  	return ret;
>  }
>  
> 

  reply	other threads:[~2021-07-26  7:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26  3:29 samirweng1979
2021-07-26  7:55 ` Krzysztof Kozlowski [this message]
2021-07-26 11:30 ` patchwork-bot+netdevbpf
  -- strict thread matches above, loose matches on Subject: below --
2021-04-02 12:15 samirweng1979
2021-04-02 16:28 ` Krzysztof Kozlowski

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=94177278-c8fe-89f3-97f0-7010078b9ba2@canonical.com \
    --to=krzysztof.kozlowski@canonical.com \
    --cc=k.opasiak@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=samirweng1979@163.com \
    --cc=wengjianfeng@yulong.com \
    --subject='Re: [PATCH] nfc: s3fwrn5: remove unnecessary label' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).